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:
For an in depth explanation of all the deployment options available for .net core applications, checkout the following articles:
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.
The following steps are necessary to create .exe i.e. executable files which are as 1) Open visual studio framework 2) Then, create a new project or application 3) Build or execute your application by pressing F5
Source: Stackoverflow.com