Blazor the type or namespace name 'App' could not be found (are you missing a using directive or an assembly reference?)

ε祈祈猫儿з 提交于 2019-12-10 15:39:06

问题


I have setup the basic application in Blazor in Microsoft Visual Studio Community 2019 Version 16.1.3 and I have tried both of the versions of .NET Core SDK 3.0.100-preview5-011568 and SDK 3.0.100-preview6-012264.

Also I have installed the Blazor extension but when I am building without any modification in any files, the build fails with the following error:

"The type or namespace "App" could not be found.

Any help will be highly appreciated. Thanks.


回答1:


To use Blazor you need to have VS2019 preview edition or enable preview features on VS2019 by checking

Tools -> Options -> Environment -> Preview Features -> Use previews of the .NET Core SDK

or on the older versions of VS2019

Tools -> Options -> Projects and Solutions -> .NET Core -> Use previews of the .NET Core SDK

checkbox, then reload the solution and build.




回答2:


Addition to @SᴇM answer, please make sure you are using latest version of Visual studio. For my case, I followed the same steps mentioned by @SᴇM but still option Blazor App option not shown.

After that, I updated visual studio to 16.3.7 and now option is visible while creating new project. :)



来源:https://stackoverflow.com/questions/56576553/blazor-the-type-or-namespace-name-app-could-not-be-found-are-you-missing-a-us

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!