Bookmark and Share

MSBuild Parsing

by KodefuGuru 10. December 2008 15:35

In a prior post, I claimed that MSBuild parses a file in order. Further testing shows this is only partially true.

MSBuild loads the project file and any imported files. The imported files are inlined; imagine if the imported file was copied and pasted where the import element is defined. Then, all PropertyGroups are parsed in order. After that, ItemGroups are parsed in order. This means you cannot define a property, use it as metadata in an item, then redefine the property later.

It doesn't matter whether or not you define properties and items above or below a target, the target will use them.

blog comments powered by Disqus

KodefuGuru.GetInfo()

Chris Eargle
LinkedIn Twitter Technorati Facebook

Chris Eargle
C# MVP, INETA Community Champion


MVP - Visual C#

 

INETA Community Champions
Friend of RedGate
Telerik .NET Ninja
Community blogs & blog posts

I am a #52er

I have joined Anti-IF Campaign


World Map

Tag cloud

Disclaimer

The opinions expressed herein are my own personal opinions and do not represent my employer's view in any way.

© Copyright 2010