简体   繁体   English

.NET Core中的Crossgen编译

[英]Crossgen compilation in .NET Core

I have been using .NET Core for some time now. 我已经使用.NET Core已有一段时间了。 And I have created a Console App. 我已经创建了一个控制台应用程序。 Everything works however I heard that I can compile .NET Core app assembly into a native assembly using CrossGen. 一切正常,但是我听说可以使用CrossGen将.NET Core应用程序程序集编译为本机程序集。 Which quoting their documentation: 其中引用他们的文档:

To help make your app start up faster, CoreCLR includes a tool called CrossGen, which can pre-compile the MSIL code into native code. 为了帮助您更快地启动应用程序,CoreCLR包含一个名为CrossGen的工具,该工具可以将MSIL代码预先编译为本机代码。

I have been trying for a long time right now and I have really no idea, how can I do this. 我已经尝试了很长时间,但我真的不知道该怎么做。 There is really little documentation for CrossGen and even less questions here at StackOverflow. CrossGen的文档很少,而StackOverflow上的问题甚至更少。

How can I compile my .NET Core App to native code using CrossGen on a Mac? 如何在Mac上使用CrossGen将.NET Core应用程序编译为本机代码? I'd appreciate if somebody could answer this question with given examples. 如果有人可以通过给出的示例回答这个问题,我将不胜感激。

crossgen is a tool that comes bundled with CoreCLR in the NuGet package, or is built alongside it from source. crossgen是与NuCL软件包中的CoreCLR捆绑在一起的工具,或从源代码中与其一起构建。 The OSX runtime package for CoreCLR here has crossgen in tools/crossgen path inside the nuget archive. 这里的 CoreCLR的OSX运行时软件包在nuget存档内的tools/crossgen路径中具有crossgen。

If you run the tool without any arguments, it should give you basic usage instructions. 如果您运行的工具没有任何参数,它应该为您提供基本的使用说明。 Generally, what you will want to do is run crossgen <path-to-your-app> . 通常,您要执行的是运行crossgen <path-to-your-app>

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM