Wednesday, June 3, 2009

Creating a Simple MSBuild Project

Hi,

Today I would like to share on creating a simple MSBuild Project for Windows Forms Applications.

Though MSBuild can support for multiple Applications types like Windows Forms Applications, Web Services, Web Applications, Smart Device Applications, Windows services, Console Applications, Hosted Applications. we will work on creating a simple MSBuild project for Windows Form Applications (also called as Smart Clients).

To create a simple MSBuild project follow these steps:

  1. 1. Start Visual Studio, and create a new C# Windows application named MSBuild1.
  2. Accept the defaults, and click OK.
  3. In the Form Designer, drag and drop a new label onto the form.
  4. Set the text of the label to MSBuild demo.

The form should look like :

  1. Click Save and exit.
  2. By Default your project saves under Project folder of Visual Studio 2008 (By default this folder resides at My Documents, e.g: C:\Documents and Settings\<Username>\My Documents\Visual Studio 2008\Projects\Msbuild1)
  3. Now to run this project go to command prompt and change directory to Msbuild1 project folder (E.g :C:\Documents and Settings\<Username>\My Documents\Visual Studio 2008\Projects\Msbuild1\Msbuild1) and type >msbuild.  or type msbuild msbbuild1.csproj and hit enter.
  4. For the first time running the project you will see the following screen.

The above screen provides the following information:

  1. Looking for source target directory.
  2. Compiling the source code.
  3. Building msbuild1.exe in Debug directory.

So the summary is whatever the customization that you would like to do this can be done for msbuild1.csproj file. msbuild1.csproj file contains all information of the project which you want clean. compile,build an exe file and lot more.

Please post your feedback and queries so that I can improve my presentation skills.

Kumar.

No comments:

Post a Comment