I have just updated Visual Studio 2022 (v17.7.6) and downloaded the latest .NET 8 preview (.NET 8.0.0-rc.2) and when I create a brand new Blazor Web App project I am getting the following errors when I try to build:
The type or namespace name ‘Components’ does not exist in the namespace ‘NewBlazor’
The type or namespace name ‘Pages’ does not exist in the namespace ‘NewBlazor.Client’
Those namespaces definitely exist as they appear as options from intellisense and this is a fresh, out-of-the-box, unedited by me template.
I have set the LangVersion to preview for both projects and have tried cleaning the solution but to no avail. It doesn’t seem to matter what options I select when creating the project (authentication type, interactivity type, etc), the errors still persist.
Has anybody else encountered this issue?
>Solution :
It’s because you’re using Visual Studio 2022 and not Visual Studio 2022 preview
Which is on version 17.8.0 Preview 5.0 currently.
https://visualstudio.microsoft.com/vs/preview/