找不到任何兼容的框架版本.找不到指定的框架'Microsoft.NETCore.App'版本'2.2.0'

编程入门 行业动态 更新时间:2024-10-28 19:26:55
本文介绍了找不到任何兼容的框架版本.找不到指定的框架'Microsoft.NETCore.App'版本'2.2.0'的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我已经构建并部署了.Net Core控制台应用程序.

I had a .Net Core console app built and deployed.

该项目的Platform目标是x86.

The project's Platform target is x86.

目标框架是.Net Core 2.2(x86).

Target framework is .Net Core 2.2(x86).

尽管已安装.Net Core 2.2(x86)SDK,但是在开发人员命令提示符VS2017中执行dotnet myapp.dll命令后,出现以下错误.

Although .Net Core 2.2 (x86) SDK is installed, I get following error after executing the command dotnet myapp.dll in Developer Command Prompt VS2017.

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 versions are installed: 2.0.7 at [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] 2.0.9 at [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] 2.1.5 at [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]

.Net Core 2.2(x86)SDK安装在路径"C:\ Program Files(x86)\ dotnet \ shared"下,并且系统环境变量包含"C:\ Program Files(x86)\ dotnet \".

The .Net Core 2.2(x86) SDK was installed under path "C:\Program Files (x86)\dotnet\shared", and System Environment Variables contains "C:\Program Files (x86)\dotnet\".

有什么建议吗?谢谢!

~~~ Update1

~~~Update1

以下是.csproj信息的一部分,很抱歉无法完整显示.

Following are part of .csproj info, sorry can't show whole thing.

<Project Sdk="Microsoft.NET.Sdk"> <PropertyGroup> <OutputType>Exe</OutputType> <TargetFramework>netcoreapp2.2</TargetFramework> <Platforms>AnyCPU;x86;x64</Platforms> </PropertyGroup> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|AnyCPU'"> <PlatformTarget>x86</PlatformTarget> <Prefer32Bit>true</Prefer32Bit> </PropertyGroup> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'"> <PlatformTarget>x64</PlatformTarget> <Prefer32Bit>true</Prefer32Bit> </PropertyGroup> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x86'"> <PlatformTarget>x86</PlatformTarget> </PropertyGroup>

推荐答案

.Net Core安装似乎是一个已知问题, github/dotnet/core-setup/issues/4350

It seem to be a known issue for .Net Core installation, github/dotnet/core-setup/issues/4350

我必须卸载x64和x86的所有.Net Core软件包,然后重新安装.Net Core x86软件包.这就解决了问题.

I have to uninstall all .Net Core packages, both x64 and x86, then reinstalled .Net Core x86 package. And that solved the problem.

更多推荐

找不到任何兼容的框架版本.找不到指定的框架'Microsoft.NETCore.App'版本'2.2.0'

本文发布于:2023-11-05 11:42:59,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1560748.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:找不到   框架   版本   App   NETCore

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!