Run the solution from the Visual Studio console without opening the IDE

I am using Visual Studio 2010 SP1.

What I tried the first time:

  • Open the Visual Studio console tool from the Start menu
  • Go to the project folder (which already contains the executable file)
  • Run: msbuild myproject.sln or msbuild myproject.sln /p:Configuration=Release
  • This happens successfully, but I can not find the executable to run

  • The second thing I tried is steps 1 and 2 on top
  • Launch: devenv myproject.sln /Build and devenv myproject.sln /Run
  • This works somewhat, but it seems to open the IDE to start the build
  • The thing is not to use the ideal at all.

Now, how do I create and run a solution without opening an IDE?

-------------------------- FIXED ----------------- ------ -------

The problem was that I was looking for the wrong place for the executable (noob error). I ended up using this batch file:

 msbuild myproj.sln /p:configuration=Release cd (("Path to executable" usually in the Debug/Release Folder)) myExecutableName cd (("Path to original folder")) 
+4
source share
1 answer
  • Go to the solutions folder
  • Run: msbuild myproject.sln / p: Configuration = Release (or debugging)
  • cd myproject (in the folder with your solution, this is a subfolder)
  • cd bin
  • cd Release (or Debug)
  • Run: myproject.exe

You can replace three separate cd commands with one:

 cd myproject\bin\Release 

Or just run the executable from the solutions folder:

 myproject\bin\Release\myproject.exe 
+8
source

All Articles