.NET Core can't add Razor pages

Viewed 593

enter image description here

enter image description here

As you can see with the images above when I go to add a new razor page instead of taking me to the razor page prompt it instead takes me to add new item and doesn't let me add a razor page. Does anyone know why this is caused? I also need to use an empty razor page for this project.

1 Answers

You have to make sure you have the "ASP.NET and web development" workload installed within Visual Studio.

In Visual Studio go to Tools -> Get Tools and Features... and make sure "ASP.NET and web development" is ticked and then click Modify / Install.

ASP.NET and dev Development workload

I had the exact same problem and managed to fix it by following the above steps.

Related