Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

Tags:

c#

projects

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?

like image 975
tintincutes Avatar asked Jun 29 '09 11:06

tintincutes


People also ask

How do you compile a solution?

In Solution Explorer, choose multiple files that can be compiled, open the shortcut menu for one of those files, and then choose Compile, or press Ctrl+F7.

How do I compile a project in C#?

CSharp Online TrainingOpen the command prompt tool and go to the directory where you saved the file. Type csc helloworld. cs and press enter to compile your code. If there are no errors in your code, the command prompt takes you to the next line and generates helloworld.exe executable file.

How do I compile in Visual Studio release mode?

In Solution Explorer, right-click the project and choose Properties. In the side pane, choose Build (or Compile in Visual Basic). In the Configuration list at the top, choose Debug or Release. Select the Advanced button (or the Advanced Compile Options button in Visual Basic).


1 Answers

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! :)
like image 95
Matthew Scharley Avatar answered Sep 22 '22 05:09

Matthew Scharley