https://github.com/ascpixi/dotnet-ilc
🛠A .NET tool wrapper to manually run ilc - the IL compiler.
https://github.com/ascpixi/dotnet-ilc
dotnet dotnet-tool dotnet-tools nativeaot
Last synced: about 1 year ago
JSON representation
🛠A .NET tool wrapper to manually run ilc - the IL compiler.
- Host: GitHub
- URL: https://github.com/ascpixi/dotnet-ilc
- Owner: ascpixi
- License: mit
- Created: 2024-07-11T01:36:13.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2025-01-15T23:40:05.000Z (over 1 year ago)
- Last Synced: 2025-03-19T10:30:02.969Z (about 1 year ago)
- Topics: dotnet, dotnet-tool, dotnet-tools, nativeaot
- Language: C#
- Homepage: https://www.nuget.org/packages/ilc
- Size: 10.7 KB
- Stars: 7
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
- License: LICENSE
Awesome Lists containing this project
README
# dotnet-ilc
`dotnet-ilc` is a simple .NET tool wrapper over the `ilc` compiler provided by .NET 7.0 and higher, which is used for Native AOT (NAOT) compilation.
This tool is available under the NuGet package name `ilc`. In order to install it, use the following command:
```
dotnet tool install -g ilc
```
The tool will automatically retrieve the right versions based on the .NET runtime that is used to invoke the tool. This means that you might experience a measurable delay the first time you launch the tool with a new .NET version.
## Use-cases
This tool is mainly intended for use when compiling with a custom set of runtime libraries and/or assemblies. If you wish to compile with .NET's runtime libraries, it's recommended to use a regular .NET project. Alternatively, you can reference the assemblies from the coressponding `runtime..microsoft.dotnet.ilcompiler` packages, where `` is the runtime identifier of the **target** operating system.
If you're using C#, you can also check out [bflat](https://flattened.net/), which also uses `ilc` under the hood, but automatically compiles C# files to IL assemblies.
## Why a wrapper?
The internal NuGet packages used to store `ilc` - `runtime..microsoft.dotnet.ilcompiler` - are meant to be used as project dependencies. These packages also supply various build specification files, which reference the stored `ilc` binary.
This wrapper removes the need for scripts to manually locate the NuGet global packages folder, or to use hacks such as creating a temporary project just to install the internal package. It automatically determines the host system runtime ID and .NET version, and retrieves the right package. In case of an non-major .NET version upgrade, the tool will automatically retrieve new files.