MSBuild in Visual Studio Part 12: Compiling Inside Visual Studio

We’ve touched briefly on how the Compile target is used by Visual Studio, but only on how it relates to Intellisense. Of course while Intellisense is nice, most people would like to actually compile a complete application using Visual Studio. If you’re reading this blog you likely already know that MSBuild is used for the…

8

How To: Conditionally Apply Metadata to Items

Last week we got a great question over on our forum about applying metadata to items depending on a condition. What the author wanted to was something like this:  <ItemGroup>  <Compile Include=”MyClass.boo”>   <DefineConstants Condition=” ‘$(Configuration)’ == ‘Debug’>OnForThisFile</DefineConstants>  </Compile> </ItemGroup> It isn’t documented in our MSDN reference (which we’ll get fixed), but as the original author discovered this works…


MSBuild in Visual Studio Part 11: Other Special Targets

The last two entries walked through how the Compile target is used by the IDE to drive certain features. There are a number of other targets that get called at various times. Several targets exist to help compute project output groups, which are sets of files related to the project. These are useful when the…

2

MSBuild in Visual Studio Part 10: What Does MSBuild Have To Do With Intellisense?

In our last post we started to dig into how the Compile target is used by Visual Studio at design time, and the details around the in-process compiler. When Rajeev was talking about the in-process vs. out-of-process compiler during the talk I must admit I started to doze off a bit. I’m much more of…

2

A Pretty Picture of Our Project Dependencies

As you may have noticed from our recent posts on build parallelization, we’re thinking a lot lately about project dependencies. One thing I’ve always wanted is a tool that let me visually look at the project-to-project references that make up my application. A couple of weekends ago I hacked together an application that uses the…

8

How To: Update Assembly Version Numbers with MSBuild

UPDATE: For information on the “Y7K” or “2007” issue, see our new blog entry.  One of our most frequently asked questions is: “How do update my assembly version numbers at build time?”. Unfortunately our answer has been “you can’t”. Until today, that is. I just posted a new task, AssemblyInfoTask, at GotDotNet. It provides complete support…

62

Sprint 9 Review

It’s been about a month since we last talked about Sprint 9, and it’s time for an update. If you recall, the MSBuild team was planning on two parallel sprints: one for platform investigations and one to support internal dogfooding efforts. Last Friday marked the end of the sprints, and on Monday we held our…

415

How To: Wrap Custom Targets Around a Solution Build

We got the following question on the msbuild@microsoft.com alias last week: I’m migrating from VS2003/NAnt to VS2005/MSBuild for my build solution, and want to create a custom project that does the following: Pre-build actions Sync my source from source control Build the .sln file that Visual Studio uses Post-build actions Deploy the output of the…

212

MSBuild in Visual Studio Part 9: Compiling at Design-Time Using the In-Process Compiler

All the posts so far in our series have talked about reading from and writing to project files. I hope you’ve found all that interesting, but today we’re going to shift gears a bit and start to talk about how Visual Studio leverages MSBuild during design-time. If you’ve played with MSBuild .targets files before you…


Parallelizing Visual Studio solutions

One of the MSBuild Team’s scenarios for multi-proc builds is the automatic parallelization of Visual Studio solutions. For this scenario, we want Visual Studio to automatically parallelize all “independent” projects, and serialize all “dependent” ones. The key here is the separation of projects into the “independent” and “dependent” buckets. The separation is entirely based on…

4