I just finished designing a simple code program. I called it a "Guessing Game". The program is so far working fine and I would like to open it without opening my Microsoft Visual Studio.
How can I do that?
The easiest way is:
- Find the dropdown box at the top of Visual Studio's window that says "Debug"
- Select "Release"
- Hit
F6to build it - Switch back to Debug and then close Visual Studio
- Open Windows Explorer and navigate to your projects folder (My Documents\Visual Studio 200x\Projects\my_project)
- Now go to bin\Release\ and copy the executable from there to wherever you want to store it.
- Make shortcuts as appropriate and enjoy your new game! :)
On your project folder, open up the bin\Debug subfolder and you'll see the compiled result.
In the project file is folder "bin/debug/your_appliacion_name.exe". This is final executable program file.
Compile the Release version as .exe file, then just copy onto a machine with a suitable version of .NET Framework installed and run it there. The .exe file is located in the bin\Release subfolder of the project folder.
If you cannot find the .exe file, rebuild your solution and in your "Output" from Visual Studio the path to the file will be shown.
I'm using Visual Studio 2017.
- Go to dropdown box build.
- Choose Pubish Guessing Game (or whatever your project is called.
- Wiz Box opens so tell it where to publish it and click Next.
- Choose how to install (I usually choose CD-ROM). click Next.
- Choose updates check (I usually choose no check) click Next.
- Click Finish
It will publish, complete with setup file to the location you specified.
Hope this helps
来源:https://stackoverflow.com/questions/1057878/how-to-compile-the-finished-c-sharp-project-and-then-run-outside-visual-studio