C# · CodeProject · Dotnet

Simple way to build solution with out opening VS (TIP)

Dear Reader,

I learned some thing new (for myself) but could be an old news for you. Any ways just wish to share it with you all in case if 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 this 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:
  3. Press enter and your build is started. Its quick and easy. You also can make it a batch script too.
  4. Output is shown on the command prompt itself as shown:

Enjoy, happy coding  🙂

P.S: if you are aware of much better idea kindly do let me know.

EDIT: Thanks to @Cdhowie for below tip.

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


Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s