How to create a dotnet core single executable

2019-04-05 13:45发布

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

The project is similar to the one generated with dotnet new:

{
  "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": {}
   }
}

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.

1条回答
Juvenile、少年°
2楼-- · 2019-04-05 14:11

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.

查看更多
登录 后发表回答