c# - 如何从命令行发布 .Net Core ASP 便携版本?
问题描述
我需要为每个操作系统(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)。
解决方案
你可以在这里找到所有运行时的列表runtime.json。取自.NET Core RID(运行时标识符目录)目录。
例如
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"
推荐阅读
- c++ - 如果其中一个方法在子类中有重写,C++ 有没有办法强制重写一组方法?
- mysql - MySQL:使用别名定义 CONCAT 的数据类型
- python - 根据列表中元素的数量过滤嵌套字典
- android - afterTextChanged 切换设备方向时自动触发
- javascript - 我想多次打印数组值
- angular - 在表单更改并且在 Angualr 和 RxJS 中出现延迟后立即执行某项操作的正确方法是什么?
- javascript - 为什么 switch case 中的逻辑 OR 运算符会表现得很奇怪?
- windows - 尝试启动进程时出现powershell错误
- android-studio - 未解析的对数组和 simple_spinner_item 布局的引用
- python - 如何删除属性?