dotnetpublish 不创建运行时目录

Ced*_*tol 5 .net msbuild .net-core dotnet-cli

尝试发布一个控制台应用程序以在 Linux 计算机上运行,​​我像这样发布

dotnet publish -c Release -r linux-x64
Run Code Online (Sandbox Code Playgroud)

我尝试运行该应用程序并收到此错误

An assembly specified in the application dependencies manifest (XXX.deps.json) was not found:
    package: 'runtime.linux-x64.Microsoft.NETCore.App', version: '2.2.0'
    path: 'runtimes/linux-x64/native/createdump'
Run Code Online (Sandbox Code Playgroud)

我尝试使用发布配置文件发布到新的输出目录。

dotnet publish -p:PublishProfile=Properties\PublishProfiles\FolderProfile.pubxml -o:Release/OutP5
Run Code Online (Sandbox Code Playgroud)

现在我的输出目录包含一个“runtime”目录,但其中没有 linux-x64 目录,我尝试在 pubxml 中添加 RuntimeIdentifier 元素,没有更改,我尝试使用发布配置文件,但也指定了运行时:

dotnet publish -p:PublishProfile=Properties\PublishProfiles\FolderProfile.pubxml -o:Release/OutP6 -r linux-x64
Run Code Online (Sandbox Code Playgroud)

现在我的新输出目录没有运行时目录。

我正在输掉这场打地鼠游戏,但我不知道为什么。我缺少什么?