alt text

I have a simple .NET Core Console Application

We can now make a single .EXE runnable Console Application file in .NET Core 3


alt text

Here is my Open Source project which looks in your current directory and opens up the .sln file in Visual Studio. It is a tool I use every day for the last few years

Lets bring it up to the latest version of .NET Core 3.1 and just have a single .exe file to distribute. (handy check to see what version of .NET Core you’ve got installed dotnet --version)

Single File Executable

From MS Docs if you run the following command you’ll get a single exe.

dotnet publish -c Release -r win10-x64 -p:PublishSingleFile=true

alt text

Wow this is a large exe for essentially a very simple app, lets make it smaller:

Assembly Linking to make smaller

Assembly linking docs - add in PublishedTrimmed


Lets run publish again and see if the trimmed exe is smaller:

dotnet publish -c Release -r win10-x64 -p:PublishSingleFile=true

alt text


Scott Hanselman has a good post on this but I couldn’t get it working as he did with all config in the .csproj file.

4th July 2020 Update

After a strange error that I’m not sure why happened:

“An assembly specified in the application dependencies manifest (d.deps.json) was not found: package: ‘’, version: ‘3.1.3’ path: ‘Microsoft.Win32.Registry.dll’”

I recompiled the solution again using VS tooling which is nice:

alt text


It makes me very happy to be able to distribute a single .exe again for my console apps.