I'm writing a baremetal OS kernel in C# and I would like to execute the .Net AOT compiler from the command line without using the dotnet command, also avoiding the use of a csproj file.
On searching my file system, I notice a copy of the ILC, the Native AOT compiler, stored in the following location on my local machine: C:\Users\frank\.nuget\packages\runtime.win-x64.microsoft.dotnet.ilcompiler\7.0.14"\tools
I can actually call it successfully, ilc <args>
, and it does perform the ahead of time compilation.
Unfortunately, I have no idea how it got there and I need a reliable way to setup a fresh build environment.
How can I deterministically install, and then run, the .Net AOT compiler? (either .Net version 7 or 8 is fine).