我正在尝试将网络框架中的一些旧代码移植到网络核心。我已经在Windows 10中成功做到了(它可以完全编译并运行)。我现在正在尝试使其在MacOS Mojave中运行,因为我有一台Mac,并且不想使用虚拟机。
代码可以正确编译,但是当它尝试运行时,系统会说找不到合适的网络核心版本。
我已经尝试过重新安装以前安装了netcore的Visual Studio。
我还尝试过“ hello world”示例,它可以编译并完美运行。
它显示的错误是:
It was not possible to find any compatible framework version
The specified framework 'Microsoft.WindowsDesktop.App', version '3.0.0-preview5-27626-15' was not found.
- No frameworks were found.
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
dotnet --info提供:
~ dotnet --info
SDK de .NET Core (reflejando cualquier global.json):
Version: 3.0.100-preview5-011568
Commit: b487ff10aa
Entorno de tiempo de ejecución:
OS Name: Mac OS X
OS Version: 10.14
OS Platform: Darwin
RID: osx.10.14-x64
Base Path: /usr/local/share/dotnet/sdk/3.0.100-preview5-011568/
Host (useful for support):
Version: 3.0.0-preview5-27626-15
Commit: 61f30f5a23
.NET Core SDKs installed:
2.1.505 [/usr/local/share/dotnet/sdk]
3.0.100-preview5-011568 [/usr/local/share/dotnet/sdk]
.NET Core runtimes installed:
Microsoft.AspNetCore.All 2.1.9 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.All]
Microsoft.AspNetCore.App 2.1.9 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 3.0.0-preview5-19227-01 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App]
Microsoft.NETCore.App 2.1.9 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]
Microsoft.NETCore.App 3.0.0-preview5-27626-15 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]
我不知道问题可能出在哪里;我希望程序能够运行,因为已经安装了正确的运行时。
答案 0 :(得分:2)
您似乎正尝试使用Mac OS不支持的Windows Forms / WPF框架。