How to create exe of a console application

an EXE file is created as long as you build the project. you can usually find this on the debug folder of you project.

C:\Users\username\Documents\Visual Studio 2012\Projects\ProjectName\bin\Debug

Normally, the exe can be found in the debug folder, as suggested previously, but not in the release folder, that is disabled by default in my configuration. If you want to activate the release folder, you can do this: BUILD->Batch Build And activate the "build" checkbox in the release configuration. When you click the build button, the exe with some dependencies will be generated. Now you can copy and use it.


For .net core 2.1 console application, the following approaches worked for me:

1 - from CLI (after building the application and navigating to debug or release folders based on the build type specified):

dotnet appName.dll

2 - from Visual Studio

R.C solution and click publish
'Target location' -> 'configure' ->
   'Deployment Mode' = 'Self-Contained'
   'Target Runtime' = 'win-x64 or win-x86 depending on the OS'

References:

  • https://stackoverflow.com/a/44039013/5063433
  • https://stackoverflow.com/a/52443448/5063433

For an in depth explanation of all the deployment options available for .net core applications, checkout the following articles:

  • https://docs.microsoft.com/en-us/dotnet/core/deploying/deploy-with-vs?tabs=vs156
  • https://docs.microsoft.com/en-us/dotnet/core/deploying/deploy-with-cli

Tags:

C#

Winforms