Publishing C# console application

2019-03-25 14:08发布

问题:

I have developed a C# console application using VS2010. Now i would like to make it into a setup.exe. Is it possible to have this setup.exe as a standalone file to run my program? Meaning how can i achieve in obtaining setup.exe that when i click on that file it will run my console without even opening VS and without the need of my project folder on the workstation. I have tried numerous time doing myself but failed up till now. Some advice please.

Thanks, 10e5x

回答1:

You can publish it. Go to your solution explorer. Right click on it. publish the application. After finishing the publishing wizard, you can get the set up file in publish folder. or you can simply copy the exe file directly from the Bin folder and paste it wherever you want. Hope this is helpful.



回答2:

Follow the Steps

1) Firslty build the code 2) Then go to your projects folder 3) Open Debug/Bin 4) Inside Bin you can see the exe file. That file you can copy on any work station and run your console application.

Please do remember be confirm in which .NET version ur program is compiled. If suppose you compiled your program in .NET version 3.5 and running your program in .NET version 2 . It will not work

Thanks