How to compile the finished C# project and then run outside Visual Studio?

独自空忆成欢 提交于 2019-12-17 18:16:31

问题


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?


回答1:


The easiest way is:

  • Find the dropdown box at the top of Visual Studio's window that says "Debug"
  • Select "Release"
  • Hit F6 to 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! :)



回答2:


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.




回答3:


I'm using Visual Studio 2017.

  1. Go to dropdown box build.
  2. Choose Pubish Guessing Game (or whatever your project is called.
  3. Wiz Box opens so tell it where to publish it and click Next.
  4. Choose how to install (I usually choose CD-ROM). click Next.
  5. Choose updates check (I usually choose no check) click Next.
  6. Click Finish

It will publish, complete with setup file to the location you specified.

Hope this helps




回答4:


On your project folder, open up the bin\Debug subfolder and you'll see the compiled result.




回答5:


In the project file is folder "bin/debug/your_appliacion_name.exe". This is final executable program file.




回答6:


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.

Build solution path.



来源:https://stackoverflow.com/questions/1057878/how-to-compile-the-finished-c-sharp-project-and-then-run-outside-visual-studio

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!