I am using Visual Studio 2019 Version 16.3.7. I assume it is the latest update.
When I try to compile a basic .NET Core 2.2 console application:
...I ge
For whatever reason, .NET Core 2.2 is not installed by the ".NET Core cross-platform development" workload.
Open up the Visual Studio installer then go to the "Individual components" tab and you can install it from there:
You can install x86 .NET Core 2.2.x Platform SDK as @Martin said.
If you do not need x86 version like me, you can also set
<PlatformTarget>AnyCPU</PlatformTarget>
to
<PlatformTarget>x64</PlatformTarget>
in both main project and test project 's .csproj file
to avoid this problem.
In my case was missing x86 .NET Core 2.2.x Platform SDK (Visual Studio .NET 16.4 + .NET Core 3.1 SDK ; xUnit Test Project).
You can try this:
C:\Program Files (x86)\dotnet\shared\Microsoft.NETCore.App
?dotnet --info