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.
You can do this in the latest version of Visual Studio 2017 just by using
Add New Item
and choosingRazor Page
.You can also use
dotnet new
. For example:See the documentation for
dotnet new
. You can always get started by just runningdotnet new
alone to see the available templates.