3 ms·
This is something that hosed me up too at first when using Blazor. There is a specific item type in the VS "Add New Item" dialog that is called "Razor Component
by bob1029 7y ago
This is something that hosed me up too at first when using Blazor. There is a specific item type in the VS "Add New Item" dialog that is called "Razor Component" with a fancy purple icon next to it.
If your files in the solution explorer end in .razor, you are using the correct item type. If your files end in .cshtml, you are going to have a bad time and everything will seem very wrong. At first, I was using the "Add->Razor Page" context menu option assuming this was what I wanted, but it will give you the wrong type of item.