Razor component item template uses wrong extension
See original GitHub issueSteps:
- In VS solution explorer, right-click on a folder inside a Blazor project (e.g., the
Pagesfolder) and choose Add -> Item - From the dialog, choose Razor Component
Expected: Prompted file extension should be .razor
Actual: It’s .cshtml
Sidenote: It would be great if the Razor Component item template also appeared in the initial context menu alongside Razor Page and Controller

Issue Analytics
- State:
- Created 4 years ago
- Comments:5 (5 by maintainers)
Top Results From Across the Web
Visual Studio Razor Component Item Template User ...
When adding a Razor Component Item Template from the Add New Item screen in Visual Studio it throws: Error Parsing the User Settings...
Read more >Template based components · Issue #16308
At its most basic, Blazor components+templates should still be recognizably HTML+Razor codes. Declarative syntax fits this bill, which can be < ...
Read more >ASP.NET Core Razor components
Learn how to create and use Razor components in Blazor apps, including guidance on Razor syntax, component naming, namespaces, and component ...
Read more >Razor component button @onclick not calling c# method
If it's Blazor, watch an up to date Blazor video and start with deploying the standard Blazor Template. Your code works in a...
Read more >Don't replace your View Components with Razor ...
In this post I take a brief look at Razor Components, and whether you should consider using them instead of View Components.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

As to the first question about the incorrect default filename for Razor Component, I checked in a fix to the vstemplate file stub for that template yesterday. It should flow into Visual Studio builds in the next few days.
In regards to the sidenote, this is something that would need to be implemented in the VS Web Tools component.
Thanks @phenning!