Joh*_*ley 6 linux windows cross-compiling kestrel-http-server asp.net-core-1.0
我在Windows工作,想在Windows上构建一个dotnet核心应用程序,以便在Linux上运行.在build文件夹中,我看到已发布文件夹中的.DLL文件引用,这显然不适用于Linux - 如何从我的Windows环境编译应用程序以在Linux上运行?可能吗?
在project.json文件中指定了运行时版本,我认为这与C:\ Program Files\dotnet\sdk\1.0.0-preview2-003121\runtimes位置中的运行时相关联?如果是这样,我如何在Windows中安装Linux运行时并引用它?
您可以使用发布命令创建自包含应用程序。
例如(.Net Core 2.0):
dotnet publish -c release -r win7-x64
dotnet publish -c release -r centos.7-x64
Run Code Online (Sandbox Code Playgroud)
RuntimeIdentifiers您还需要在.csproj文件中指定 win7-x64 或 centos.7-x64 。
| 归档时间: |
|
| 查看次数: |
1373 次 |
| 最近记录: |