I recently installed Blazor as part of my Visual Studio Community 2019 version 16.3.2 installation. After creating a brand new Blazor Server web application in VS 2019 I have tried to run the app, only to get 3 errors in the build. The errors are:
Error: Project "C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Current\Microsoft.Common.targets\ImportAfter\Microsoft.Web.ImportAfter.targets" was not imported by "C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Current\Bin\Microsoft.Common.CurrentVersion.targets" at (6101,3), due to the file being invalid. OktaBlazorAspNetCoreServerSide C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Current\Microsoft.Common.targets\ImportAfter\Microsoft.Web.ImportAfter.targetsError: Project "C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Microsoft\VisualStudio\Managed.Web\Microsoft.Web.Designtime.targets" was not imported by "C:\Program Files\dotnet\sdk\3.0.100\Sdks\Microsoft.NET.Sdk.Web.ProjectSystem\targets\Microsoft.NET.Sdk.Web.ProjectSystem.targets" at (42,5), due to the file being invalid. OktaBlazorAspNetCoreServerSide C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Microsoft\VisualStudio\Managed.Web\Microsoft.Web.Designtime.targetsError MSB4024 The imported project file "C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Current\Microsoft.Common.targets\ImportAfter\Microsoft.Web.ImportAfter.targets" could not be loaded. Root element is missing. OktaBlazorAspNetCoreServerSide C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Current\Bin\Microsoft.Common.CurrentVersion.targets
I haven't encountered MSBuild errors like this before and I need some directions. I am using .Net Core 3.0.100. If I use dotnet run from the command line the project runs as expected.
<Project>tag in it. Also, is VS2019 and .net core 3.0.1 the only version in your current machine, any preview version in it? I didn't found same issue like this, but found some similar issues which are about VS-preview or .net sdk preview... Hope the info helps :)dotnet --infoand3.0.100-preview-010184SDK is installed