Reputation: 4205
Starting to work with a web app and following the steps here to use razor pages
Is there a template (either in VS or elsewhere) for adding a new razorpage (ie the cshtml and the cshtml.cs files)? As a workaround I created an MVC View page (with the .cshtml ext) and then created a .cs file and renamed it to match the naming pattern.
I'm having problems running the scaffolding as well but that is a separate issue.
Upvotes: 0
Views: 1019
Reputation: 93083
You can do this in the latest version of Visual Studio 2017 just by using Add New Item
and choosing Razor Page
.
You can also use dotnet new
. For example:
dotnet new page --name MyPage
See the documentation for dotnet new
. You can always get started by just running dotnet new
alone to see the available templates.
Upvotes: 1