如何创建dotnet核心单个可执行文件 [英] How to create a dotnet core single executable

查看:231
本文介绍了如何创建dotnet核心单个可执行文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想将dotnet核心项目配置为可编译为单个可执行文件。

I would like to configure my dotnet core project to compile as a single executable.

该项目类似于使用 dotnet生成的项目。新建

{
  "version": "1.0.0-*",
  "buildOptions": {
    "debugType": "portable",
    "emitEntryPoint": true
  },
  "dependencies": {},
  "frameworks": {
    "netcoreapp1.1": {
      "dependencies": {
        "Microsoft.NETCore.App": {
          "version": "1.1.0"
        }
      },
      "imports": "dnxcore50"
    }
  },
  "runtimes": {
     "win10-x64": {}
   }
}

如何制作所以这作为一个单独的program.exe编译?当我运行 dotnet publish 时,它将dll和program.exe放在一个发布文件夹中,但没有将它们组合在一起。

How can I make it so this compiles as a single program.exe? When I run dotnet publish it puts dlls and the program.exe in a publish folder, but doesn't combine them.

推荐答案

最接近答案的可能是 CoreRT .Net Core 到Native)。它将非常适合,但存在小问题-该项目仍处于早期阶段。一年前,他们向我们展示了演示,但这只是一个非常简单的示例,对于更高级的项目将无法正常工作。一些更多信息如何尝试执行此操作

The closest to answer is probably CoreRT (.Net Core to Native). It will be excellent fit but exist small problem - This project is still in early apha. A year ago they showed us demo but it was a very simple example and for more advanced projects will not work. Some more information how to try do this.

这篇关于如何创建dotnet核心单个可执行文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆