Home > ASP.NET > How to compile .NET Core Console Application as .exe File?

How to compile .NET Core Console Application as .exe File?


When you compile .NET Core Console Application it will generate DLL file instead of exe file for the build project.

NET Core 3.0+ projects will now include an executable file for the platform you build on by default. This is just an executable and your main logic is still inside a .dll file.

But .NET Core 3.0 also introduced single-file deployments so deploying with

dotnet publish -r win-x64 -p:PublishSingleFile=True --self-contained false

will create a single .exe file containing all your dependencies. You can change --self-contained to true to also include the .NET Core Runtime as well so .NET Core does not need to be installed globally on the target machine.

You can also do this from Visual Studio Publish

.NET Core Publish

Hope it helps!

  1. No comments yet.
  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: