如何在 Visual Studio Mac 上创建针对 Ubuntu 的独立构建?

问题描述 投票:0回答:0

目标是能够运行 shell 文件,在 MacBook(Intel CPU)上构建我的 .Net 项目。

我正在运行以下命令:

dotnet build --restore --self-contained --runtime ubuntu.20.04-x64 --output "$TARGET" "$SOLUTION" --configuration Release 

我希望我应该能够构建一个针对 ubuntu 20.04 服务器的独立解决方案。相反,我收到以下错误:

/usr/local/share/dotnet/sdk/7.0.306/Current/SolutionFile/ImportAfter/Microsoft.NET.Sdk.Solution.targets(27,5):错误NETSDK1134:不支持使用特定的 RuntimeIdentifier 构建解决方案。如果您想针对单个 RID 进行发布,请改为在单个项目级别指定 RID。 [/Users/myUser/Development/GIT/project/myProject/project.sln]

如果我希望能够通过终端运行它并根据需要针对不同的环境,我缺少什么?

visual-studio .net-core visual-studio-mac
© www.soinside.com 2019 - 2024. All rights reserved.