【问题标题】:How to publish .Net Core ASP portable version from command line?如何从命令行发布 .Net Core ASP 便携版本?
【发布时间】:2019-07-01 05:47:33
【问题描述】:

我需要为每个操作系统(win-32、win-64、Linux)构建 1 个版本。 在 Visual Studio 中,您可以选择何时发布:依赖于框架和可移植。但我需要在 Jenkins 上完成。

我试过使用命令:

dotnet publish myapp.csproj --self-contained false --configuration Release --runtime ??? --output "С:\myapp"

但运行时:“any”、“portable”不起作用。

VS如何构建依赖params框架和可移植的? 我没有使用 MSBuild、dotnet build 或 dotnet MSBuild,因为发布命令添加了一些独特的文件(web.config、资源)并删除了无用的文件(dep*.json)。

【问题讨论】:

    标签: c# jenkins .net-core msbuild


    【解决方案1】:

    您可以在此处runtime.json 找到所有运行时的列表。取自.NET Core RID (Runtime Identifier Catalog) Catalog

    例如

    dotnet publish myapp.csproj --self-contained false --configuration Release --runtime "alpine.3.7" --output "С:\myapp_alpine_3_7"
    
    dotnet publish myapp.csproj --self-contained false --configuration Release --runtime "linuxmint.19.2-x64" --output "С:\myapp_linuxmint_19_2_x64"
    

    【讨论】:

    • 当我使用 RID 文章中的“任何”时 - 错误:NETSDK1056。我想要1个版本。有可能吗?
    • 没有。这不可能。你可以玩输出目录。我更新了答案。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2021-05-11
    • 2020-10-11
    • 1970-01-01
    • 2021-07-21
    • 2019-09-29
    • 2011-01-12
    • 1970-01-01
    相关资源
    最近更新 更多