COMPILE .NET CORE CONSOLE APPLICATION AS .EXE FILE
When we compile .NET Core Console Application it generates a DLL file instead of exe file for the building 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 still remains in 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
This will create a single executable (exe) file containing all your dependencies. we 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.
We can also do this from Visual Studio Publish

Comments
Post a Comment