我已经构建并部署了.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'
发布评论