Cross compiling in .NET Core

I have been using .NET Core for some time. And I created a console application. Everything works, however, I heard that I can compile the .NET Core assembly into an assembly using CrossGen. Which cites their documentation:

To speed up the launch of the application, CoreCLR includes a CrossGen tool that can precompile MSIL code into native code.

I tried it a long time ago and I have no idea how I can do this. There is very little documentation for CrossGen and even less questions here at StackOverflow.

How can I compile a .NET Core application for native code using CrossGen on Mac? I would appreciate it if someone could answer this question with the examples given.

+5
source share
1 answer

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

If you run the tool without any arguments, it should give you basic usage instructions. Typically, you need to execute crossgen <path-to-your-app> .

+3
source

All Articles