Developer knowledge network · moderated exchange

UnreliableCode コミュニティ

開発者リサーチ、リバース エンジニアリング、コーディング コミュニティ

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.