如何创建dotnet核心单个可执行文件

编程入门 行业动态 更新时间:2024-10-25 01:28:07
本文介绍了如何创建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核心单个可执行文件

本文发布于:2023-11-16 18:29:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1606741.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:可执行文件   核心   dotnet

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!