Loading

VS2019 发布单文件

在项目.csproj文件下添加

<PropertyGroup>
    <OutputType>Exe</OutputType>
    <TargetFramework>netcoreapp3.0</TargetFramework>
    <PublishSingleFile>true</PublishSingleFile>
    <RuntimeIdentifier>linux-arm</RuntimeIdentifier>
</PropertyGroup>

RuntimeIdentifier 为发布的平台,必填

可以选择win-x64 win-x86 等等

选择项目右键发布,编辑配置 选择操作系统平台 发布

 

以下示例将 Windows 应用作为独立的单文件应用程序发布。

.NET Core CLi
dotnet publish -r win-x64 -p:PublishSingleFile=true --self-contained true

 

以下示例将 Linux 应用作为依赖框架的单文件应用程序发布。

.NET Core CLi
dotnet publish -r linux-x64 -p:PublishSingleFile=true --self-contained false

 

https://docs.microsoft.com/zh-cn/dotnet/core/deploying/single-file

 

posted @ 2019-10-09 12:06  microestc  阅读(1588)  评论(0编辑  收藏  举报