【笔记】aspnetcore 发布到 linux 命令
关于如何把.Net runtime
安装到Linux
,网上一堆帖子,也可以移步官网 在 Linux 上安装 .NET和托管和部署 ASP.NET Core。
这里只记录ASP.NET Core
发布Linux
命令:
dotnet publish
--os Linux
--arch arm64
--self-contained false
-c Release
-o .\bin\Release\linux-arm64
解析:
● --os Linux:目标操作系统为 Linux
● --arch arm64:目标操作系统架构为 arm64
● --self-contained false: .NET 运行时随应用程序一同发布,因此无需在目标计算机上安装运行时。false 为仅发布项目,不包含运行时
● -c Release:生成配置,默认为Debug。发布到生产环境建议用Release
● -o .\bin\Release\linux-arm64:目标路径