0
votes

So i wanted to get starting with .NET blazor and for some reason i have compiler errors. The program works as expected if i run it tough, But the errors bugs me. The steps i did are:

  • Downloaded and installed latest .net core 3.0,
  • Installed the Blazor templates using dotnet new -i Microsoft.AspNetCore.Blazor.Templates::3.0.0-preview6.19307.2
  • Enabled preview features of the .net at visual studio
  • Installed Blazor extension from the Visual Studio Marketplace

And i get this error enter image description here

The error says "the name '' does not exist in current context

UPDATE I installed visual studio 2019 preview as @Henry Rodriguez suggested, The errors were indeed gone, But when i added a new Todo.razor page (as in this tutorial https://docs.microsoft.com/en-us/aspnet/core/tutorials/build-your-first-blazor-app?view=aspnetcore-3.0) I got the errors again, What could be the solution to this problem? enter image description here

2
I'd suggest you to delete this app, reboot, and create this app afresh. Hope this works... You may as well provide a link to your app... - enet

2 Answers

0
votes

Blazor is meant to be used with Visual Studio Preview versions enter image description here

You can find it here https://visualstudio.microsoft.com/vs/preview/

You can have several different VS versions installed side by side without problems, they won't interfere between them.

0
votes

I solved the issue, In case someone having the same problem - What happen is that i needed to add a .razor page to the project. When i right clicked and choose 'Add razor page' from the menu it actually added a .cshtml page. What i did then was just adding a text file which ends with .razor