Windows上面编译.net9.0的linux平台代码
- 安装.net 9.0 sdk
- visual stuio code 安装 c# 和 .net 的扩展
- dotnet.exe build -c Release
- dotnet publish -c Release -f net9.0 -r linux-x64 –self-contained true
[project_file_folder]/bin/[configuration]/[framework]/[runtime]/publish/
生成的publish目录下面的文件 拿到linux就能运行
参考:
https://learn.microsoft.com/zh-cn/dotnet/core/tools/dotnet-publish
https://learn.microsoft.com/zh-cn/dotnet/core/deploying/deploy-with-cli
https://learn.microsoft.com/zh-cn/dotnet/standard/frameworks
https://learn.microsoft.com/zh-cn/dotnet/core/rid-catalog