Skip to content

Support Single-File Apps in .NET 5 #36590

Closed
@swaroop-sridhar

Description

@swaroop-sridhar

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:

  • Framework-dependent

    • Publish command: dotnet publish -r win-x64 --self-contained=false /p:PublishSingleFile=true
    • Published files: HelloWorld.exe, HelloWorld.pdb
  • Self-contained (Linux)

    • Publish command: dotnet publish -r linux-x64 /p:PublishSingleFile=true
    • Published files: HelloWorld, HelloWorld.pdb
  • Self-contained (Windows):

    • Publish command: dotnet publish -r win-x64 /p:PublishSingleFile=true
    • Published files: HelloWorld.exe, HelloWorld.pdb, coreclr.dll, clrjit.dll, clrcompression.dll, mscordaccore.dll
  • Self-contained (Windows) with bundled native components:

    • Publish command: dotnet publish -r win-x64 /p:PublishSingleFile=true /p:IncludeNativeLibrariesInSingleFile=true
    • Published files: HelloWorld.exe, HelloWorld.pdb

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

Metadata

Metadata

Labels

EpicGroups multiple user stories. Can be grouped under a theme.area-Single-File

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions