The Artima Developer Community
Sponsored Link

.NET Buzz Forum
MSBuild: The New Build System for Visual Studio 2005 and Longhorn

0 replies on 1 page.

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 0 replies on 1 page
Tim Sneath

Posts: 395
Nickname: timsneath
Registered: Aug, 2003

Tim Sneath is a .NET developer for Microsoft in the UK.
MSBuild: The New Build System for Visual Studio 2005 and Longhorn Posted: Jul 18, 2004 5:04 PM
Reply to this message Reply

This post originated from an RSS feed registered with .NET Buzz by Tim Sneath.
Original Post: MSBuild: The New Build System for Visual Studio 2005 and Longhorn
Feed Title: Tim Sneath's Blog
Feed URL: /msdnerror.htm?aspxerrorpath=/tims/Rss.aspx
Feed Description: Random mumblings on Microsoft, .NET, and other topics.
Latest .NET Buzz Posts
Latest .NET Buzz Posts by Tim Sneath
Latest Posts From Tim Sneath's Blog

Advertisement

MSBuild is the new build system in Visual Studio 2005. It has been built from the ground up in managed code, with scalability, performance and extensibility as core goals.

When designing MSBuild, the development team had several different customer audiences that they kept in mind:

  • The Developer - someone who writes and compiles code regularly;
  • The Build Developer - someone who implements the processes for the build environment;
  • The Build Lab Tech - the person responsible for kicking off and managing the build process, making sure that builds don't break and fixing them as necessary. Note that this person may well not have Visual Studio on their machine.
  • The Build Lab Manager - who needs to track progress of the project and the build success/fail status. This individual would also probably not be a VS user.

MSBuild is actually built into the operating system, rather than the development environment. This means you can build Visual Studio projects without VS installed; all you need is Windows (and .NET Framework 2.0 until Longhorn).

MSBuild is driven by project files, which are created either by Visual Studio (automatically) or by hand by a developer. These are XML files that describe the build process elements (targets: build, clean, rebuild etc. that each contain constituent tasks) and inputs (items and properties). The project file is ultimately fed into the MSBuild engine, which in turn then generates the output.

The XML input to MSBuild is of course strongly-typed; the schema ships with VS 2005 Beta 1 and is called msbuild.xsd: if you include the namespace definition in Visual Studio when editing with its inbuilt XML editor, you'll get full Intellisense when working with MSBuild project files.

You can write the entire build process from scratch, if you like: here's a sample build project that compiles a C# application:

<?xml version="1.0" encoding="utf-8" ?>
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
   <PropertyGroup>
      <OutputPath>Bin\</OutputPath>
      <AssemblyName>MSBuildSample</AssemblyName>
   </PropertyGroup>
  
   <ItemGroup>
      <Compile Include="MSBuildSample.cs"></Compile>
      <Reference Include="System.dll"></Reference>
   </ItemGroup>
 
<Target Name="Build">
   <MakeDir Directories="$(OutputPath)"
            Condition="!Exists('$(OutputPath)')" />
   <Csc Sources="@(Compile)"
        References="@(Reference)"
        OutputAssembly="$(OutputPath)$(AssemblyName).exe" />
   </Target>
</Project>

To make the process simpler, MSBuild reuses elements of the build process through the use of .targets files, which define a compile target which is the override for any defaults. For example, Microsoft.CSharp.targets defines how to build C# applications with MSBuild; a similar file exists for J# and VB in the .NET Framework 2.0 directory (as specified in the LIBPATH environment variable).

Read: MSBuild: The New Build System for Visual Studio 2005 and Longhorn

Topic: Picasa Previous Topic   Next Topic Topic: TechEd Europe: Wrapup

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use