Blazor Webassembly Load failed - Something with Dotnet sdk

Viewed 1283

So my project doesn't load (unloaded/load failed).

enter image description here

I get this message in my output window:

C:\Users\username\source\repos\MyProject\MyProject.csproj : error  : The project file cannot be opened. C:\Program Files\dotnet\sdk\3.1.403\Sdks\Microsoft.NET.Sdk.BlazorWebAssembly\Sdk not found. Check that a recent enough .NET Core SDK is installed and/or increase the version specified in global.json.

I have the newest Version of VS2019:

enter image description here

I allowed the use of previews of the .NET Core SDK

enter image description here

SDK 3.1.403 is installed.

enter image description here

My Project has no global.json. I tried to create global.json in my root folder.

{
  "sdk": {
    "version": "3.1.403"
  }
}

but it also did not work.

I downloaded and installed both .NET Core SDK x64 and x86.

My .csproj

<Project Sdk="Microsoft.NET.Sdk.BlazorWebAssembly">

  <PropertyGroup>
    <TargetFramework>net5.0</TargetFramework>
    <ServiceWorkerAssetsManifest>service-worker-assets.js</ServiceWorkerAssetsManifest>
  </PropertyGroup>

  <ItemGroup>
    <PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly" Version="5.0.0-rc.2.20475.17" />
    <PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.DevServer" Version="5.0.0-rc.2.20475.17" PrivateAssets="all" />
    <PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.Authentication" Version="5.0.0-rc.2.20475.17" />
    <PackageReference Include="System.Net.Http.Json" Version="5.0.0-rc.2.20475.5" />
  </ItemGroup>

  <ItemGroup>
    <ServiceWorker Include="wwwroot\service-worker.js" PublishedContent="wwwroot\service-worker.published.js" />
  </ItemGroup>

</Project>

I restarted VS2019 and my Device everytime I changed anything.

Please help. I'm desperate. How can I work on this Solution?

0 Answers
Related