Visual Studio for Mac上的独立Linux 64软件包

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

[在Visual Studio 2019 for Windows中使用.NET Core应用程序时,我可以选择将应用程序发布为Windows,Linux或Mac程序包,取决于框架或自包含。我一定缺少明显的东西,但是如何在Mac的Visual Studio中做同样的事情?它只是发布内容而无需任何选择。

我尝试手动编辑发布配置文件以包含最后两行:

<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
  <PropertyGroup>
    <WebPublishMethod>FileSystem</WebPublishMethod>
    <PublishProvider>FileSystem</PublishProvider>
    <LastUsedBuildConfiguration>Release</LastUsedBuildConfiguration>
    <LastUsedPlatform>AnyCPU</LastUsedPlatform>
    <publishUrl>../../dist</publishUrl>
    <ExcludeAppData>False</ExcludeAppData>
    <DeleteExistingFiles>true</DeleteExistingFiles>
    <TargetFramework>netcoreapp3.1</TargetFramework>
    <RuntimeIdentifier>linux-64</RuntimeIdentifier>
    <SelfContained>true</SelfContained>
  </PropertyGroup>
</Project>

但是它们似乎没有作用。

visual-studio .net-core visual-studio-mac self-contained
1个回答
0
投票

我最终在.NET CLI中完成了此操作

dotnet publish -o dist/  -r linux-x64 src/

如果指定运行时标识符-默认情况下,它将生成自包含的程序包。

© www.soinside.com 2019 - 2024. All rights reserved.