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

前端 未结 5 1741
南旧
南旧 2021-01-18 02:39

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

5条回答
  •  挽巷
    挽巷 (楼主)
    2021-01-18 03:06

    In my case the problem was that I had the following package reference in my csproj file:

    Removing this fixed the issue.

    The following output in my build.log file helped me track this down

    1>/usr/local/share/dotnet/sdk/3.1.402/Sdks/Microsoft.NET.Sdk.Razor/build/netstandard2.0/Sdk.Razor.CurrentVersion.targets(404,5): warning RAZORSDK1006: Detected Razor language version downgrade. This is typically caused by a reference to the Microsoft.AspNetCore.Razor.Design package. Consider removing this package reference.
    

提交回复
热议问题