The goal of this effort is enable .Net-Core apps to be published and distributed as a single executable.
Goals
The .Net 5.0 single file solution should be:
- Widely compatible: Apps containing IL assemblies, ready-to-run assemblies, composite assemblies, native binaries, configuration files, etc. can be packaged into one executable.
- Can run managed components of the app directly from bundle, without need for extraction to disk.
- Usable with debuggers and tools.
User Experience
Here's the overall experience for publishing a HelloWorld single-file app in .net 5:
Design Document
A detailed discussion of the goals, non-goals, related-work, options, design decisions, and implementation details of supporting single-file apps is available in this design document
Tracking Progress
The goal of this effort is enable .Net-Core apps to be published and distributed as a single executable.
Goals
The .Net 5.0 single file solution should be:
User Experience
Here's the overall experience for publishing a HelloWorld single-file app in .net 5:
Framework-dependent
dotnet publish -r win-x64 --self-contained=false /p:PublishSingleFile=trueHelloWorld.exe,HelloWorld.pdbSelf-contained (Linux)
dotnet publish -r linux-x64 /p:PublishSingleFile=trueHelloWorld,HelloWorld.pdbSelf-contained (Windows):
dotnet publish -r win-x64 /p:PublishSingleFile=trueHelloWorld.exe,HelloWorld.pdb,coreclr.dll,clrjit.dll,clrcompression.dll,mscordaccore.dllSelf-contained (Windows) with bundled native components:
dotnet publish -r win-x64 /p:PublishSingleFile=true /p:IncludeNativeLibrariesInSingleFile=trueHelloWorld.exe,HelloWorld.pdbDesign Document
A detailed discussion of the goals, non-goals, related-work, options, design decisions, and implementation details of supporting single-file apps is available in this design document
Tracking Progress
PublishSingleFile. Single-File: Update Bundler Invocation. sdk#11586deps.jsonandruntimeconfig.jsonfiles directly from bundle. Single-File: Process bundles in the framework #34274SingleFileHostwithAppHost,HostFxr, andHostPolicystatically linked. Single-File: Implement statically linked apphost #32823 Build an apphost with hostfxr and hostpolicy linked in #36230SingleFileHostwith host and runtime components statically linked.CoreCLRandClrJITwithSingleFileHostSingle-File: Implement Linux SingleFileHost with statically linked runtime #37119 Host with coreclr linked in #36847SingleFileHostSingleFile: Statically link core native libraries to Linux SingleFileHost #38304AppContext.BaseDirectoryshould return the location of the single-file executable Single-File: Process bundles in the framework #34274