question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Razor component item template uses wrong extension

See original GitHub issue

Steps:

  1. In VS solution explorer, right-click on a folder inside a Blazor project (e.g., the Pages folder) and choose Add -> Item
  2. 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

image

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:5 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
phenningcommented, Jun 6, 2019

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.

0reactions
mkArtakMSFTcommented, Jun 7, 2019

Thanks @phenning!

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found