【发布时间】:2020-01-24 21:59:45
【问题描述】:
我正在尝试让我的 dotnet Core 应用程序在安装了 dotnet core 运行时的 ubuntu 18.04LTS 机器上运行。
命令:
dotnet myapp.dll
结果:
Did you mean to run dotnet SDK commands? Please install dotnet SDK from:
https://go.microsoft.com/fwlink/?LinkID=798306&clcid=0x409
据我了解,我不需要 SDK 来简单地运行此应用程序。只要运行时就足够了,对吧?
dotnet --info
Host (useful for support):
Version: 2.2.8
Commit: b9aa1abc51
.NET Core SDKs installed:
No SDKs were found.
.NET Core runtimes installed:
Microsoft.NETCore.App 2.2.8 [/usr/share/dotnet/shared/Microsoft.NETCore.App]
To install additional .NET Core runtimes or SDKs:
https://aka.ms/dotnet-download
如何在不安装 SDK 的情况下完成这项工作?
【问题讨论】:
-
嗨 Matthijs,你是如何发布你的应用程序的?你用过吗:
publish -c release -r ubuntu.18.04-x64 -
一位同事实际进行了构建。他在 Windows 上使用 Visual Studio。他是无法到达的atm。如果有帮助,我确实找到了
myapp.runtimeconfig.json文件?{ "runtimeOptions": { "tfm": "netcoreapp2.2", "framework": { "name": "Microsoft.NETCore.App", "version": "2.2.0" } } } -
运行时配置不显示应用是为 Windows 还是 Ubuntu 编译的