Developer knowledge network · moderated exchange

Супольнасць UnreliableCode

Супольнасць распрацоўшчыкаў даследаванняў, зваротнага праектавання і кадавання

Knowledge indexжыць
4Categories
919Threads
2.8KПаведамленні
Guide

NativeAOT compilation: compiling C# to pure standalone x64 native binaries

dotnet_native_aot
C# Veteran
MEMBER
прадстаўнік: 174
Дата далучэння: Sep 2021
Паведамленні: 16
Дзякуй: 62
1 месяцаў таму · Jul 10, 2026 10:49 PM
#1

How to compile C# CLI tools and memory utilities directly to native machine code in .NET:

In .csproj:

XML
<PropertyGroup>
  <PublishAot>true</PublishAot>
  <OptimizationPreference>Speed</OptimizationPreference>
  <InvariantGlobalization>true</InvariantGlobalization>
</PropertyGroup>
dotnet publish -c Release -r win-x64

Output: A tiny 6.5MB standalone .exe with no .NET runtime or DLL dependencies that boots in 3 milliseconds!

ptr_arithmetic
C++ Wizard
MEMBER
прадстаўнік: 162
Дата далучэння: May 2018
Паведамленні: 73
Дзякуй: 42
1 месяцаў таму · Jul 11, 2026 12:54 AM
#2

3ms startup time is incredible for CLI offset dumpers and scanner utilities.

segfault_sam
Member
MEMBER
прадстаўнік: 68
Дата далучэння: Mar 2019
Паведамленні: 22
Дзякуй: 57
1 месяцаў таму · Jul 11, 2026 1:26 PM
#3

NativeAOT single file binaries are so convenient to distribute.