The specified framework 'Microsoft.NETCore.App', version '2.2.0' was not found

前端 未结 3 665
太阳男子
太阳男子 2021-02-12 01:57

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

相关标签:
3条回答
  • 2021-02-12 02:34

    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:

    0 讨论(0)
  • 2021-02-12 02:52

    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.

    0 讨论(0)
  • 2021-02-12 02:58

    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:

    1. Exist directory 2.2.x in: C:\Program Files (x86)\dotnet\shared\Microsoft.NETCore.App ?
    2. When no, try Download latest 2.2.x SDK for x86 platform from this URL: https://dotnet.microsoft.com/download/dotnet-core/2.2
    3. Install and try ...
    4. For more info about installed SDK and Runtime you can use command: dotnet --info
    0 讨论(0)
提交回复
热议问题