如何使用当前预览在 .NET Core 上构建本机二进制文件? [英] How do I build a native binary on .NET Core using the current preview?
问题描述
使用当前的 .NET Core 预览版,我如何编译(发布?)控制台应用程序的本机二进制文件.我使用的是 Mac OS 10.11.
Using the current .NET Core preview, how do I compile (Publish ?) a native binary for a console application. I am on Mac OS 10.11.
我做了以下事情:
dotnet new
dotnet restore
dotnet publish
我有点期待发布"为我构建一个本地二进制文件,但它没有.它在发布文件夹中放置了一个 .dll 和一些 JSON 文件?我应该提到应用程序在使用 dotnet run
时运行良好.
I kind of expected "publish" to build a native binary for me, but it did not. It places a .dll, along with some JSON, in the publish folder ? I should mention the application runs fine when using dotnet run
.
那么,如何为我的简单控制台应用程序获取本机二进制文件?
So, how do I get a native binary for my simple console application ?
推荐答案
根据 Slack 频道上的一位 MS 开发人员的说法,RC2 中的本机编译已被删除/禁用,因为它尚未准备就绪.
According to an MS dev on the Slack channel, native compilation was removed/disabled in RC2 since it wasn't deemed ready yet.
似乎对它有点兴趣,所以我一直在争论是否要尝试从 CLI 源代码中自己运行它.
There does seem to be a little bit of interest in it, so I've been debating whether to try to get it running myself, from the CLI source.
否则,我们只能等待,但我同意,非常失望.
Otherwise, we'll just have to wait, but I agree, huge disappointment.
为了完整起见,我应该补充一点,.NET Core 和 .NET Native 可用于 UWP/Windows Store 应用程序,但显然这不是跨平台的.
just for completeness, I should add that .NET Core and .NET Native are available for UWP / Windows Store apps, though obviously this is not cross-platform.
编辑 #2:由于这似乎继续受到关注,因此计划完成的新方法是 CoreRT,目前正在积极开发中.
EDIT #2: since this seems to continue to be getting attention, the new way that this is planned on being done is CoreRT, currently in active development.
这篇关于如何使用当前预览在 .NET Core 上构建本机二进制文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!