

This already gives us the job structure of our build pipeline. NET Core 3.0 application on Windows and on Linux to a native executable and then publish both executables on the corresponding GitHub Release page. What we need is the ability to compile a. We will solve this problem with the help of an Azure Pipeline.Īzure Pipelines have a great and free GitHub integration and support CI for Windows, Linux and MacOS. This means we need a Linux host to compile the binary for Linux. We got an error that tells us that cross-compilation is not supported yet. See: aka.ms/dotnet-core-previewĬ:\Users\xxx\.nuget\packages\\1.0.0-alpha-27507-02\build\.targets(63,5):Įrror : Cross-compilation is not supported yet.

Restore completed in 40,38 sec for C:\CCGetter\src\CCGetter\CCGetter.csproj.Ĭ:\Program Files\dotnet\sdk\3.0.100-preview3-010431\Sdks\\targets\(151,5): message NETSDK1057: You are using a preview version of. NET CoreĬopyright (C) Microsoft Corporation. Microsoft (R) Build Engine version 16.0.443+g5775d0d6bb for. That's exactly what we need to distribute the command line tool. This creates an 20.6 MB single executable without any dependencies. But this time we get an AOT compiled executable instead of an JIT compiled one. To compile a native single-binary Windows executable we need to run the same command as in the self-contained executable. To do so, we add a file called nfig with the following content to our project root. To get native compilation, we need to change only two minor things in our project.įirst, we add the Intermediate-Language compiler (ILCompiler) which translates IL into native code to our package references.īecause the ILCompiler package is not available on NuGet, due to its alpha status, we need to add a reference to. NET Core 3.0 preview and with both Windows and Linux as a target - but it looks to me like that this would solve all my problems for the CCGetter tool.

I wrote about AOT compilation a while back in my blog, but never tried it with.

The project is an official Microsoft project called CoreRT and in an early development state but already usable for small applications. NET Core runtime which uses a just-in-time (JIT) compiler, there exists an ahead-of-time (AOT) compiler which produces a native single binary for each platform.
