8

After I created the blazor application in Visual studio . When i trying to run or build the application am getting this error.

I used dotnet restore and dotnet build .

user12428054
  • 135
  • 3
  • 9

3 Answers3

6

This was the fix for me https://github.com/dotnet/aspnetcore/issues/20857

If you check the build ouput window, you might see a more useful error like:

Build output error

This showed that I needed to install the lastest .NET runtime from https://dotnet.microsoft.com/download/dotnet-core/thank-you/runtime-aspnetcore-3.1.5-windows-hosting-bundle-installer

TomDane
  • 1,010
  • 10
  • 25
4

For me, installing 2.1 SDK did the trick. Here is the link to it: https://dotnet.microsoft.com/download/dotnet/2.1

Areeha
  • 823
  • 7
  • 11
  • 1
    I was setting up new laptop and the VS 2019 installation only installed SDK 5. Existing projects using Core 2.0 were erroring out during the build. This solved it. thanks. – Alex Nov 04 '21 at 19:29
0

I updated Visual Studio to 2019 v16.9.2 and that fixed it for me. I also read another post where repairing the VS installation fixed the problem. My problem started mysteriously after everything had been working for some time, so I don't think it was an issue with the version. I think just running the upgrade repaired the installation.

Droobie
  • 91
  • 1
  • 8