Reputation: 101
I have a C# project in Visual Studio 2019 that I wish to export as a .EXE file. I have already run it in 'Release' Mode, but no .exe turns up in the 'bin' folder - just a '.deps', '.dll', '.pdb', '.runtimeconfig.dev' and a '.runtimeconfig'. I believe I am using a trial for the Enterprise version - does the trial allow this exporting? Thanks.
Upvotes: 1
Views: 22471
Reputation: 24470
Per the comments:
The process of converting source code to a binary (exe, dll, etc) is called compiling
or building
the code, rather than exporting
it.
To build the code from the command line you can run dotnet publish:
dotnet publish -r win-x64 -c Release --self-contained
By targeting the Windows platform (set by the -r
/ --runtime
parameter) a program will become an executable. Other platforms don't use exe
files; so a non runtime specific build would create a dll
as that can be used on a variety of platforms.
.csproj
file in an editor.OutputType
to WinExe
(Windows Application) or Exe
(Console Application).You can update the CS Project File by editing it directly, or by navigating the to the relevant settings in your IDE. Assuming that's Visual Studio:
Solution Explorer
windowProperties
Application
sectionOutput Type
property to Windows Application
or Console Application
.Upvotes: 0
Reputation: 680
Likely you have a library project as part of the solution and you are looking in the library's bin folder for the exe. It will not be there if that is the case. You will only find the dll in that bin folder.
1 - Right Click your project that youre expecting the output to be an EXE
2 - Click "Open Folder in File Explorer"
3 - you should see a bin folder here, navigate in and you'll find your Release and Debug folders.
Upvotes: 1