<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://blogs.msdn.com/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>MSBuild Team Blog : Jeffery Callahan</title><link>http://blogs.msdn.com/msbuild/archive/tags/Jeffery+Callahan/default.aspx</link><description>Tags: Jeffery Callahan</description><dc:language>en-US</dc:language><generator>CommunityServer 2.1 SP1 (Build: 61025.2)</generator><item><title>New Registry syntax in MSBuild v3.5</title><link>http://blogs.msdn.com/msbuild/archive/2007/05/04/new-registry-syntax-in-msbuild-v3-5.aspx</link><pubDate>Sat, 05 May 2007 01:25:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:2416286</guid><dc:creator>msbuild</dc:creator><slash:comments>7</slash:comments><comments>http://blogs.msdn.com/msbuild/comments/2416286.aspx</comments><wfw:commentRss>http://blogs.msdn.com/msbuild/commentrss.aspx?PostID=2416286</wfw:commentRss><description>&lt;P&gt;During development of the &lt;A class="" title="MSBuild Multi-targeting" href="http://blogs.msdn.com/msbuild/archive/2006/11/03/msbuild-orcas-and-multi-targeting.aspx" target=_blank mce_href="http://blogs.msdn.com/msbuild/archive/2006/11/03/msbuild-orcas-and-multi-targeting.aspx"&gt;multi-targeting&lt;/A&gt; feature of the next version of MSBuild, we found it convenient to expose a new method for accessing the registry from project and target files.&amp;nbsp; I hadn't really thought much more about it since we implemented it, but today I needed to make a change to Microsoft.Common.targets for which this new syntax was perfect, so I thought I'd share.&lt;/P&gt;
&lt;P&gt;So here's how it works:&amp;nbsp; suppose there's some value in the registry you're interested in consuming.&amp;nbsp;&amp;nbsp;Using the 2.0 version of&amp;nbsp;MSBuild, you may have written a task which took the names of the key and value, and output the value of the value (ha, I always think it's funny saying that).&amp;nbsp; Now, with the 3.5 version of MSBuild, it's very simple.&amp;nbsp; Say the key you're interested in is "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\.NETFramework" and the value at that key you'd like to retrieve is "InstallRoot".&amp;nbsp; On my machine, this value is set to "C:\WINDOWS\Microsoft.NET\Framework\".&amp;nbsp; In your project/targets file - anywhere a property reference is allowed (which is pretty much everywhere), you could obtain this value with the property&lt;/P&gt;
&lt;BLOCKQUOTE&gt;
&lt;P&gt;$(Registry:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\.NETFramework@InstallRoot)&lt;/P&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;This sort of shows off the pieces of the new syntax, which can be described like this&lt;/P&gt;
&lt;BLOCKQUOTE&gt;
&lt;P&gt;&lt;STRONG&gt;$(Registry:&lt;/STRONG&gt;&lt;EM&gt;&amp;lt;key name&amp;gt;[@&amp;lt;value name&amp;gt;]&lt;/EM&gt;&lt;STRONG&gt;)&lt;/STRONG&gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Note the value name is optional - this is because the registry supports a notion of default values.&amp;nbsp; If you omit the value from the specification, MSBuild will simply retrieve the default value (if it exists).&lt;/P&gt;
&lt;P&gt;I think this is a neat new feature which hopefully many of you will find useful.&amp;nbsp; Enjoy!&lt;/P&gt;
&lt;P&gt;[ Author: Jeffery Callahan ]&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=2416286" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/msbuild/archive/tags/Jeffery+Callahan/default.aspx">Jeffery Callahan</category></item><item><title>New Reference Assemblies Location</title><link>http://blogs.msdn.com/msbuild/archive/2007/04/12/new-reference-assemblies-location.aspx</link><pubDate>Thu, 12 Apr 2007 21:16:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:2102664</guid><dc:creator>msbuild</dc:creator><slash:comments>12</slash:comments><comments>http://blogs.msdn.com/msbuild/comments/2102664.aspx</comments><wfw:commentRss>http://blogs.msdn.com/msbuild/commentrss.aspx?PostID=2102664</wfw:commentRss><description>&lt;P&gt;Those of you who've been using the 3.0 Framework may have noticed a folder under Program Files called "Reference Assemblies".&amp;nbsp; This folder contains those assemblies that ship with the 3.0 Framework which are useful for referencing during the design and build of new components.&amp;nbsp; Those of you who haven't yet used the 3.0 Framework, but plan on using the 3.5 Framework when it's released to the wild, will notice this change has continued.&lt;/P&gt;
&lt;P&gt;This change is largely about disentangling design time and runtime scenarios.&amp;nbsp; At runtime, these components will still be loaded from the GAC in most cases.&amp;nbsp; At design time, going forward there will be a single location where users can find assemblies available for reference.&amp;nbsp; This location for the 3.5 Framework is: &lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; "%ProgramFiles%\Reference Assemblies\Microsoft\Framework\v3.5"&lt;/P&gt;
&lt;P&gt;For MSBuild, we've placed the 3.5 versions of the assemblies Microsoft.Build.Engine.dll, Microsoft.Build.Framework.dll, Microsoft.Build.Conversion.v3.5.dll and Microsoft.Build.Utilities.v3.5.dll (explanation of the "v3.5" in the filenames coming in a subsequent blog post!) at this location, and as mentioned earlier they will continue installing to the GAC for runtime use.&amp;nbsp; Notice I didn't list Microsoft.Build.Tasks.v3.5.dll here - because this assembly is essentially for runtime use only, we didn't decide to install it under the Reference Assemblies location.&lt;/P&gt;
&lt;P&gt;The tools themselves that ship with the .NET Framework v3.5 (csc.exe, msbuild.exe, vbc.exe) will continue installing to their expected locations.&lt;/P&gt;
&lt;P&gt;At build time, we actually had little work to do to accommodate this change.&amp;nbsp; For the version of MSBuild that shipped with the .NET Framework 2.0, we&amp;nbsp;used a single location under the WINDOWS folder&amp;nbsp;in different ways&amp;nbsp;for different parts of the&amp;nbsp;build.&amp;nbsp; For example, the compiler tasks looked in this location to find the executable they called, and the reference resolution task (ResolveAssemblyReference) would look in this location to resolve certain system assemblies.&amp;nbsp; Now, the reference resolution task has a location set aside expressly for this purpose, so it no longer needs to inspect the location under WINDOWS (for 3.0 and 3.5, anyways).&lt;/P&gt;
&lt;P&gt;[ Author: Jeffery Callahan ]&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=2102664" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/msbuild/archive/tags/Jeffery+Callahan/default.aspx">Jeffery Callahan</category></item><item><title>Restrictions on the Exclude attribute in an item tag</title><link>http://blogs.msdn.com/msbuild/archive/2005/11/08/490576.aspx</link><pubDate>Wed, 09 Nov 2005 02:09:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:490576</guid><dc:creator>msbuild</dc:creator><slash:comments>11</slash:comments><comments>http://blogs.msdn.com/msbuild/comments/490576.aspx</comments><wfw:commentRss>http://blogs.msdn.com/msbuild/commentrss.aspx?PostID=490576</wfw:commentRss><description>&lt;P&gt;An item exclude only works with the corresponding include on the same actual item tag-- in other words, if the exclude occurs in a later item tag of the same type, it will not affect any files previously included. &lt;/P&gt;
&lt;P&gt;For example: suppose you have files &lt;CODE&gt;a.cs, b.cs, c.cs, a.dll, b.dll, c.dll&lt;/CODE&gt; in the same directory as this project file: &lt;/P&gt;&lt;CODE&gt;&lt;FONT color=#0000ff size=2&gt;
&lt;P&gt;&amp;lt;&lt;/FONT&gt;&lt;FONT color=#800000 size=2&gt;Project&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt; &lt;/FONT&gt;&lt;FONT color=#ff0000 size=2&gt;xmlns&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;=&lt;/FONT&gt;&lt;FONT size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;http://schemas.microsoft.com/developer/msbuild/2003&lt;/FONT&gt;&lt;FONT size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&amp;gt;&lt;BR&gt;&amp;nbsp; &amp;lt;&lt;/FONT&gt;&lt;FONT color=#800000 size=2&gt;Files&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt; &lt;/FONT&gt;&lt;FONT color=#ff0000 size=2&gt;Include&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;=&lt;/FONT&gt;&lt;FONT size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;*.cs&lt;/FONT&gt;&lt;FONT size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt; /&amp;gt;&lt;BR&gt;&amp;nbsp; &amp;lt;&lt;/FONT&gt;&lt;FONT color=#800000 size=2&gt;Files&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt; &lt;/FONT&gt;&lt;FONT color=#ff0000 size=2&gt;Include&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;=&lt;/FONT&gt;&lt;FONT size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;*.dll&lt;/FONT&gt;&lt;FONT size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt; &lt;/FONT&gt;&lt;FONT color=#ff0000 size=2&gt;Exclude&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;=&lt;/FONT&gt;&lt;FONT size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;a.cs&lt;/FONT&gt;&lt;FONT size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt; /&amp;gt;&lt;BR&gt;&amp;nbsp; &amp;lt;&lt;/FONT&gt;&lt;FONT color=#800000 size=2&gt;Target&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt; &lt;/FONT&gt;&lt;FONT color=#ff0000 size=2&gt;Name&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;=&lt;/FONT&gt;&lt;FONT size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;Default&lt;/FONT&gt;&lt;FONT size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&amp;gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;&lt;/FONT&gt;&lt;FONT color=#800000 size=2&gt;Message&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt; &lt;/FONT&gt;&lt;FONT color=#ff0000 size=2&gt;Text&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;=&lt;/FONT&gt;&lt;FONT size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;@(Files)&lt;/FONT&gt;&lt;FONT size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt; /&amp;gt;&lt;BR&gt;&amp;nbsp; &amp;lt;/&lt;/FONT&gt;&lt;FONT color=#800000 size=2&gt;Target&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&amp;gt;&lt;BR&gt;&amp;lt;/&lt;/FONT&gt;&lt;FONT color=#800000 size=2&gt;Project&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&amp;gt;&lt;/P&gt;
&lt;P&gt;&lt;/FONT&gt;&lt;/CODE&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;Then the output looks like this: 
&lt;P&gt;&lt;/P&gt;
&lt;UL&gt;&lt;CODE&gt;a.cs;b.cs;c.cs;a.dll;b.dll;c.dll &lt;/CODE&gt;&lt;/UL&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;In particular, &lt;CODE&gt;a.cs&lt;/CODE&gt; is &lt;EM&gt;not&lt;/EM&gt; excluded. &lt;/P&gt;
&lt;P&gt;There are several reasons why an "Exclude" only excludes items from the current item tag, instead of any item in the project file. &lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;If an "Exclude" could exclude any item that had previously been included anywhere in the project file, it would make the project file much more confusing and hard to read. Imagine a project file including *.cs, and some imported .TARGETS file excluding a.cs. The user would spend hours trying to figure out why a.cs is not getting compiled. When you see Include="*.cs" in a project file, it's very nice to be able to know for sure that all of the .CS files are being included in the project. 
&lt;LI&gt;There's really no compelling scenario for excluding items from a previous item's Include. The main scenario for "Exclude" is that you're using a wildcard in a particular "Include", but because of the simplistic syntax of wildcards, there's no way to be as specific as you would like. So you tweak the "Include" by specifying an "Exclude". It doesn't really make too much sense to do this for items that have already been included previously. 
&lt;LI&gt;Since you can have multiple items with the same "Include" (with perhaps different item attributes), it's not clear which item we would exclude if the "Exclude" could occur in any random place in the project. 
&lt;LI&gt;With VS integration, it would be extremely difficult to support certain edits to the project file if an item could be excluded anywhere in the project file. Imagine this: &lt;/LI&gt;&lt;/UL&gt;
&lt;UL&gt;&lt;CODE&gt;&lt;FONT color=#0000ff size=2&gt;
&lt;P&gt;&amp;lt;&lt;/FONT&gt;&lt;FONT color=#800000 size=2&gt;ItemGroup&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&amp;gt;&lt;BR&gt;&amp;nbsp; &amp;lt;&lt;/FONT&gt;&lt;FONT color=#800000 size=2&gt;Compile&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt; &lt;/FONT&gt;&lt;FONT color=#ff0000 size=2&gt;Include&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;=&lt;/FONT&gt;&lt;FONT size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;b.cs&lt;/FONT&gt;&lt;FONT size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt; /&amp;gt;&lt;BR&gt;&amp;lt;/&lt;/FONT&gt;&lt;FONT color=#800000 size=2&gt;ItemGroup&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&amp;gt;&lt;BR&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;....&lt;BR&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&amp;lt;&lt;/FONT&gt;&lt;FONT color=#800000 size=2&gt;ItemGroup&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&amp;gt;&lt;BR&gt;&amp;nbsp; &amp;lt;&lt;/FONT&gt;&lt;FONT color=#800000 size=2&gt;Compile&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt; &lt;/FONT&gt;&lt;FONT color=#ff0000 size=2&gt;Exclude&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;=&lt;/FONT&gt;&lt;FONT size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;a.cs&lt;/FONT&gt;&lt;FONT size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt; /&amp;gt;&lt;BR&gt;&amp;lt;/&lt;/FONT&gt;&lt;FONT color=#800000 size=2&gt;ItemGroup&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&amp;gt;&lt;/P&gt;&lt;/FONT&gt;&lt;/CODE&gt;&lt;/UL&gt;
&lt;BLOCKQUOTE dir=ltr style="MARGIN-RIGHT: 0px"&gt;
&lt;P&gt;Now the user loads this into the IDE, and in his Solution Explorer, he sees only "b.cs". Now in Solution Explorer, he renames b.cs to a.cs. What should the project file look like now? This type of thing causes unnecessary ambiguity and difficulty. &lt;/P&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;[ Author: Jeffery Callahan ]&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=490576" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/msbuild/archive/tags/Jeffery+Callahan/default.aspx">Jeffery Callahan</category></item><item><title>what happens before msbuild decides to build a target?</title><link>http://blogs.msdn.com/msbuild/archive/2005/10/14/481200.aspx</link><pubDate>Fri, 14 Oct 2005 22:00:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:481200</guid><dc:creator>msbuild</dc:creator><slash:comments>0</slash:comments><comments>http://blogs.msdn.com/msbuild/comments/481200.aspx</comments><wfw:commentRss>http://blogs.msdn.com/msbuild/commentrss.aspx?PostID=481200</wfw:commentRss><description>&lt;P&gt;there are several elements to processing a target tag:&amp;nbsp; processing its dependencies, processing the condition, and performing TLDA (top level dependency analysis) or up-to-date checks.&amp;nbsp; it can be confusing to figure out if&amp;nbsp;a target will execute or not, so we on the msbuild team toss around a nifty mnemonic to help us remember (originally pointed out by rajeev, as far as i can remember).&amp;nbsp; this is the order in which msbuild processes the attributes of a target element:&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;&lt;STRONG&gt;&lt;FONT color=#ff0000&gt;C&lt;/FONT&gt;&lt;/STRONG&gt;ondition 
&lt;LI&gt;&lt;STRONG&gt;&lt;FONT color=#ff0000&gt;D&lt;/FONT&gt;&lt;/STRONG&gt;ependsOnTargets 
&lt;LI&gt;&lt;STRONG&gt;&lt;FONT color=#ff0000&gt;I&lt;/FONT&gt;&lt;/STRONG&gt;nputs 
&lt;LI&gt;&lt;STRONG&gt;&lt;FONT color=#ff0000&gt;O&lt;/FONT&gt;&lt;/STRONG&gt;utputs&lt;/LI&gt;&lt;/UL&gt;
&lt;P&gt;notice they're in alphabetical order.&amp;nbsp; first, msbuild will evaluate the Condition.&amp;nbsp; if the Condition is false, msbuild skips the target (and never even bothers looking at the DependsOnTargets attribute).&amp;nbsp; if the Condition is true, msbuild will then execute each of the targets listed in DependsOnTargets.&amp;nbsp; once the dependencies have been built, it will then examine the Inputs and Outputs to determine if the target even needs to be built, or if it can be partially built (do you know what this means?).&amp;nbsp; then msbuild can actually begin running your tasks....&lt;/P&gt;
&lt;P&gt;[ Author: Jeffery Callahan ]&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=481200" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/msbuild/archive/tags/Jeffery+Callahan/default.aspx">Jeffery Callahan</category></item></channel></rss>