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

走远了吗. 提交于 2019-11-28 06:49:11

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! :)

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.

Build solution path.

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

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