35

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?

Sam
  • 381
  • 3
  • 15
tintincutes
  • 5,618
  • 25
  • 67
  • 86

6 Answers6

53

The easiest way is:

  • Find the drop-down 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 project's 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! :)
Matthias Braun
  • 32,039
  • 22
  • 142
  • 171
Matthew Scharley
  • 127,823
  • 52
  • 194
  • 222
  • Is it in the Solution Configuration Drop down? I've seen it before but mine is grayed out now. I don't have any idea why? – tintincutes Jun 29 '09 at 11:51
  • If you can't change it, it doesn't really matter. Look in bin\Debug\ instead then. You may not have a release configuration setup, though normally new projects get one setup automatically. All it does is strip debugging information out of the executable, which can make the program smaller and run slightly faster. – Matthew Scharley Jun 29 '09 at 11:54
  • thanks I'm in bin\Debug now but I don't see any file under Debug. – tintincutes Jun 29 '09 at 11:56
  • That's odd, but if you try to run your program inside Visual Studio, then close it all again there should be stuff there – Matthew Scharley Jun 29 '09 at 11:59
  • Not really sure how to find the bin\Debug here. I highlighted the Form.cs and select save as... and look for bin\Debug here. But it's empty. Not sure what to do next. The thing that I can do is just save. Am I on the right direction? – tintincutes Jun 29 '09 at 11:59
  • No, open Windows Explorer and look in there... The save as dialog was just an attempt by someone else to show you where to open Window Explorer in. – Matthew Scharley Jun 29 '09 at 12:01
  • yeah it's quite odd.What I did now is, I went to the folder where my program is and then click on "bin" here I saw two folders Debug and Release. Under Debug I have these files: GameGuessing.vshost.exe, GameGuessing.exe,GameGuessing.pdb, GameGuessing.vshost.exe manifest. And under Release folder, it's empty. Shall I do it here? – tintincutes Jun 29 '09 at 12:04
  • Just copy GameGuessing.exe to wherever you want it, that's the only file you need to run it outside VS. – Matthew Scharley Jun 29 '09 at 12:05
  • another question, what does it mean in your second to the last directions to go to bin\Release and copy the executable from there. Do I need to do something with the Release? – tintincutes Jun 29 '09 at 12:14
  • Alternate way to get to your project folder: with Visual Studio open on your solution, in the Solution Explorer window, right-click on the project and select "Open Folder in File Explorer" – Hans Kesting Apr 30 '21 at 14:58
1

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.

sharptooth
  • 167,383
  • 100
  • 513
  • 979
1

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

Davejade
  • 11
  • 1
0

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

Adrian Godong
  • 8,802
  • 8
  • 40
  • 62
  • hi Adrian it seems I can't find the bin\Debug? Where it is exactly located? – tintincutes Jun 29 '09 at 11:48
  • It's located in the same folder where the .cs file of your program are. Click onto any of them and select "Save As" - the dialog will open exactly in the project folder. – sharptooth Jun 29 '09 at 11:51
  • I highlighted the folder and select save as then bin\Debug and I see nothing under Debug. Shall I just click save here with the same Object name of my project is that ok? – tintincutes Jun 29 '09 at 11:54
0

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

TcKs
  • 25,849
  • 11
  • 66
  • 104
0

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.