Reputation: 531
I've created a Blazor project using .net core 3.0 preview5 and VS2019 Enterprise. I want to create .razor files, but all of my options have .cshtml extensions.
When I'm creating my project, I'm using asp.net core 3.0 and Blazor server hosted options
Upvotes: 2
Views: 2504
Reputation: 1159
In VS 2019 16.3.0, adding "Razor Component" is what worked for me.
Upvotes: 4
Reputation: 273464
What works is:
Add, Add Class
and then change .cs
to .razor
before clicking [Add]
And immediately delete all the C# stuff of course.
Or you can copy/paste/rename any existing blazor component, like index.razor
.
Upvotes: 2
Reputation: 1532
Make sure you've got the blazor extension installed.
This should then allow you to click on the Pages Directory and at the top there's an Add Razor Page option.
But I've got to admit, I tend to find it quicker to just select an existing page in the solution explorer and Ctrl-C Ctrl-V and rename it!
Note: At time of writing this is using the preview branch of Visual Studio 2019 and frameworks.
Upvotes: 1