Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I create an EXE file from Windows Forms? [closed]

Tags:

c#

winforms

I have a simple project in C#. It's a Windows Forms application.

I want to be able to make this into an EXE file to be able to give this out to some of my friends. I am using Visual Studio 2015.

Before you say that there is an application file in the bin/debug folder, yes, I know that. The thing is that I want to be able to create this into just one file where they won't be able to access the code.

like image 935
kris594 Avatar asked Dec 13 '15 20:12

kris594


People also ask

How do I make a Windows Form application executable?

Step6:- Now this is main step to create the step. Open Solution Explorer->Click on 'solution'test'('project)->Add New Project->Select other project types from left window->Select visual studio Installer->Select the setup Wizard-> write your setup name in below(mysetup)->click OK.

How do you create a setup file .exe file in Windows Forms application in Visual Studio 2019?

Go to Extensions > Manage Extensions > Online > Search, find, download and install Microsoft Visual Studio Installer Projects extension. 2). Add a new Setup Project in your solution > right-click Application Folder > Add > Project Output… > choose the corresponding Project > select Primary output > OK.


1 Answers

Very simple steps:

  1. Compile the application in Release mode:
  • Visual Studio:
    enter image description here
  • .NET Framework MSBuild: msbuild.exe ConsoleApp1.sln /t:Build /p:Configuration=Release
  • .NET Core CLI: dotnet build -c Release (you may need to configure the project to output EXE)
  1. Open the solution folder
  2. Open the application project folder
  3. Open the Bin folder
  4. Open the Release folder
  5. Copy the .exe file
  6. Share it.
like image 143
Camilo Terevinto Avatar answered Oct 24 '22 18:10

Camilo Terevinto