MSBuild with Visual Studio 2005

Can anyone tell me how to write and run msbuild using VS 2005?

thanks

0


a source to share


2 answers


The msbuild file is just a text plan file. you can even write it down in notepad and run it from the command line. If you want to run it as part of a build just

  • right click on the project
  • select Property
  • go to the "Events" tab
  • create a build event to run msbuild

For example, create a text file test.proj:



<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
   <PropertyGroup>
      <TextToShow>Hello World!!</TextToShow>
   </PropertyGroup>

   <Target Name="HelloWorld"> 
      <Message Text="$(TextToShow)" />
   </Target>
</Project>

      

and you can run it from command line like this

msbuild /target:HelloWorld test.proj

      

+1


a source


If you want to use MSBuild as a build system for Visual Studio 2005 projects, you don't need to do anything. The .csproj and .vbproj files are MSBuild files. Visual Studio solution files (.sln) can also be piped to the MSBuild.exe file. Creating a project with Visual Studio calls MSBuild.



If you need to write code that builds, modifies, and runs msbuild files, Microsoft.Build assemblies. * .llll have classes for this.

0


a source







All Articles