问题描述
我正在使用Visual Studio 2019版本16.3.7.我认为这是最新的更新.
I am using Visual Studio 2019 Version 16.3.7. I assume it is the latest update.
当我尝试编译基本的.NET Core 2.2控制台应用程序时:
When I try to compile a basic .NET Core 2.2 console application:
...我收到以下错误:
...I get the following error:
It was not possible to find any compatible framework version
The specified framework 'Microsoft.NETCore.App', version '2.2.0' was not found.
- The following frameworks were found:
1.0.1 at [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
2.0.9 at [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
2.1.11 at [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
2.1.12 at [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
2.1.13 at [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
3.0.0 at [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
You can resolve the problem by installing the specified framework and/or SDK.
The .NET Core frameworks can be found at:
- https://aka.ms/dotnet-download .
我的理解是.NET Core 3.0向后兼容.为什么Visual Studio安装程序安装了2.2版以外的所有.NET Core版本?我该如何解决这个问题?
My understanding is that .NET Core 3.0 is backward compatible. Why Visual Studio installer installed all versions of .NET Core except 2.2?How do I solve this problem?
推荐答案
无论出于何种原因,.NET Core跨平台开发"工作负载均未安装.NET Core 2.2.
For whatever reason, .NET Core 2.2 is not installed by the ".NET Core cross-platform development" workload.
打开Visual Studio安装程序,然后转到单个组件"选项卡,您可以从此处安装它:
Open up the Visual Studio installer then go to the "Individual components" tab and you can install it from there:
这篇关于找不到指定的框架'Microsoft.NETCore.App'版本'2.2.0'的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!