Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Crossgen compilation in .NET Core

Tags:

c#

.net

.net-core

I have been using .NET Core for some time now. 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. 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.

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.

How can I compile my .NET Core App to native code using CrossGen on a Mac? I'd appreciate if somebody could answer this question with given examples.

like image 339
107MP Avatar asked Jul 24 '16 21:07

107MP


1 Answers

crossgen is a tool that comes bundled with CoreCLR in the NuGet package, or is built alongside it from source. The OSX runtime package for CoreCLR here has crossgen in tools/crossgen path inside the nuget archive.

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>.

like image 73
Eric Mellino Avatar answered Oct 31 '22 17:10

Eric Mellino