Getting "NETSDK1045 The current .NET SDK does not support .NET Core 3.0 as a target" when using Blazor Asp.NetCore hosted template

During these days I had to overcome this issue on a number of different development machines/containers: eventually, I found no less than 6 different reasons that could cause this kind of error:

  1. Missing .NET Core 3 SDK (x86 or x64)
  2. .NET Core SDK preview support not enabled in VS2019
  3. VS2017 instead of VS2019
  4. Wrong SDK path in PATH environment variable(s)
  5. Wrong SDK path in MSBuildSDKsPath environment variable(s)
  6. Wrong SDK version in the project's global.json file

The workarounds for those scenarios are pretty easy to understand, you basically have to either install the proper SDK or remove the "offending" SDK reference(s). However, I did my best to document them all in this post on my blog.


Following this comment, I managed to resolve the problem by installing the x86 version of the .NET Core 3.0 additionally to the x64 version. The build worked after restarting Visual Studio (2019).