Click here to Skip to main content
15,881,248 members
Articles / All Topics

Simple Way to Build Solution Without Opening VS (TIP)

Rate me:
Please Sign up or sign in to vote.
0.00/5 (No votes)
16 Dec 2011LGPL31 min read 7.5K   2  
Here is a simple way to build solution without opening VS (TIP)

I learned something new (for myself) but it could be something that you already know. Anyways, I just wish to share it with you in case you did not know.

It may so happen that at times, we need to build dependent projects/solutions when we are working on other projects. It’s very clumsy to open those dependents projects/solutions in Visual Studio and then compile due to time consumption or repeated steps.

Instead, follow these simple yet handy steps as explained below:

  1. Launch Visual Studio 2008 Command prompt from Start -> All Applications -> Microsoft Visual Studio 2008 -> Visual Studio Tools -> Visual Studio 2008 Command Prompt
  2. Once the command window opens up, type msbuild as command and drag and drop the required csproj or solution file from your views (Windows explorer window) into the command window as shown:

    Image 1

  3. Press enter and your build is started. It's quick and easy. You can make it a batch script too.
  4. Output is shown on the command prompt itself as shown:

    Image 2

Enjoy. Happy coding! :)

P.S: If you are aware of a much better idea, kindly let me know.

EDIT: Thanks to @Cdhowie for the below tip.

If you are on Linux, then you can use xbuild command. If you are in the same directory as the solution, then the xbuild command automatically takes it for building (only if one solution is present) without any additional arguments being passed.

Filed under: C#, CodeProject, Dotnet
Tagged: .NET, blog, C#, codeproject, Dotnet, tips
Image 4 Image 5 Image 6 Image 7 Image 8 Image 9 Image 10 Image 11

License

This article, along with any associated source code and files, is licensed under The GNU Lesser General Public License (LGPLv3)


Written By
Software Developer (Senior) Siemens
India India
A .net developer since 4+ years, wild, curious and adventurous nerd.

Loves Trekking/Hiking, animals and nature.

A FOSS/Linux maniac by default Wink | ;)

An MVP aspirant and loves blogging -> https://adventurouszen.wordpress.com/

Comments and Discussions

 
-- There are no messages in this forum --