<?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 : Faisal Mohamood</title><link>http://blogs.msdn.com/msbuild/archive/tags/Faisal+Mohamood/default.aspx</link><description>Tags: Faisal Mohamood</description><dc:language>en-US</dc:language><generator>CommunityServer 2.1 SP1 (Build: 61025.2)</generator><item><title>7 Steps to MSBuild</title><link>http://blogs.msdn.com/msbuild/archive/2006/12/05/7-steps-to-msbuild.aspx</link><pubDate>Tue, 05 Dec 2006 04:10:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:1208576</guid><dc:creator>msbuild</dc:creator><slash:comments>4</slash:comments><comments>http://blogs.msdn.com/msbuild/comments/1208576.aspx</comments><wfw:commentRss>http://blogs.msdn.com/msbuild/commentrss.aspx?PostID=1208576</wfw:commentRss><description>&lt;P&gt;Brennan has a great &lt;A class="" href="http://brennan.offwhite.net/blog/2006/11/30/7-steps-to-msbuild/" mce_href="http://brennan.offwhite.net/blog/2006/11/30/7-steps-to-msbuild/"&gt;post&lt;/A&gt; about all things MSBuild, and covers good breadth on both&amp;nbsp;concepts, as well as the many things you may want to drive with MSBuild&amp;nbsp;(unit testing, web deployment projects,&amp;nbsp;etc). Check it out!&lt;/P&gt;
&lt;P&gt;[ Author : Faisal Mohamood ]&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=1208576" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/msbuild/archive/tags/Faisal+Mohamood/default.aspx">Faisal Mohamood</category><category domain="http://blogs.msdn.com/msbuild/archive/tags/How+To/default.aspx">How To</category></item><item><title>Multi-Targeting : How does it work?</title><link>http://blogs.msdn.com/msbuild/archive/2006/11/15/multi-targeting-how-does-it-work.aspx</link><pubDate>Wed, 15 Nov 2006 04:30:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:1079050</guid><dc:creator>msbuild</dc:creator><slash:comments>15</slash:comments><comments>http://blogs.msdn.com/msbuild/comments/1079050.aspx</comments><wfw:commentRss>http://blogs.msdn.com/msbuild/commentrss.aspx?PostID=1079050</wfw:commentRss><description>&lt;P&gt;So in my &lt;A class="" href="http://blogs.msdn.com/msbuild/archive/2006/11/03/msbuild-orcas-and-multi-targeting.aspx" mce_href="http://blogs.msdn.com/msbuild/archive/2006/11/03/msbuild-orcas-and-multi-targeting.aspx"&gt;last post&lt;/A&gt;, I described the multi-targeting feature at a very high level. I discussed how there will be three frameworks that you can build "for", and how there will be two toolsets - i.e. .NET Framework 2.0 / MSBuild 2.0 toolset, and the .NET Framework 3.5 / MSBuild 3.5 toolset.&lt;/P&gt;
&lt;P&gt;Recall that&amp;nbsp;the capability we have added to MSBuild as a part of this feature is the ability for you to take a project, and build it using either toolset. MSBuild 3.5 supports a new command line parameter known as ToolsVersion that allows you to specify which toolset you want to build using, and is invoked as shown:&lt;/P&gt;&lt;SPAN style="FONT-SIZE: 11pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Courier New'; mso-fareast-font-family: Calibri; mso-fareast-theme-font: minor-latin; mso-ansi-language: EN-US; mso-fareast-language: EN-US; mso-bidi-language: AR-SA"&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 10pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Courier New'"&gt;msbuild WindowsApplication1.csproj /ToolsVersion:3.5&lt;?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 11pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Courier New'; mso-fareast-font-family: Calibri; mso-fareast-theme-font: minor-latin; mso-ansi-language: EN-US; mso-fareast-language: EN-US; mso-bidi-language: AR-SA"&gt;&lt;FONT face=Arial&gt;&lt;FONT size=2&gt;&lt;FONT face="Courier New"&gt;ToolsVersion &lt;/FONT&gt;is the parameter that you use to force a project to build using a specific toolset. There are only two toolsets available out of the box, but you can also set up "custom" toolsets depending on your needs, and MSBuild can be used to build projects using those that you have defined. More on that later.&lt;/FONT&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="FONT-SIZE: 11pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Courier New'; mso-fareast-font-family: Calibri; mso-fareast-theme-font: minor-latin; mso-ansi-language: EN-US; mso-fareast-language: EN-US; mso-bidi-language: AR-SA"&gt;&lt;FONT face=Arial size=2&gt;So, the next question obviously is, what happens when you build a project using a specific ToolsVersion, and what are the mechanics in action behind the scenes?&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="FONT-SIZE: 11pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Courier New'; mso-fareast-font-family: Calibri; mso-fareast-theme-font: minor-latin; mso-ansi-language: EN-US; mso-fareast-language: EN-US; mso-bidi-language: AR-SA"&gt;&lt;FONT face=Arial size=2&gt;To understand this, we have to know a bit about how our project files are described. A standard Visual Studio&amp;nbsp;managed&amp;nbsp;project includes an import statement like the one shown below that is responsible for pulling in all the MSBuild / managed code build process into the project:&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;SPAN style="FONT-SIZE: 11pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Courier New'; mso-fareast-font-family: Calibri; mso-fareast-theme-font: minor-latin; mso-ansi-language: EN-US; mso-fareast-language: EN-US; mso-bidi-language: AR-SA"&gt;&lt;FONT color=#0000ff size=2&gt;
&lt;P&gt;&amp;lt;&lt;/FONT&gt;&lt;FONT color=#800000 size=2&gt;Import&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt; &lt;/FONT&gt;&lt;FONT color=#ff0000 size=2&gt;Project&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;$(MSBuildBinPath)\Microsoft.CSharp.targets&lt;/FONT&gt;&lt;FONT size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt; /&amp;gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color=#0000ff size=2&gt;&lt;SPAN style="FONT-SIZE: 11pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Courier New'; mso-fareast-font-family: Calibri; mso-fareast-theme-font: minor-latin; mso-ansi-language: EN-US; mso-fareast-language: EN-US; mso-bidi-language: AR-SA"&gt;&lt;FONT face=Arial color=#000000 size=2&gt;In MSBuild 2.0 (Visual Studio 2005 release), &lt;FONT face="Courier New" color=#0000ff&gt;$(MSBuildBinPath) &lt;/FONT&gt;evaluated to the location of MSBuild 2.0, i.e. the .NET Framework 2.0 install path. In order to import the new version of &lt;STRONG&gt;Microsoft.CSharp.targets&lt;/STRONG&gt;, naturally this needs to change to location of Microsoft.CSharp.targets that ship along with MSBuild 3.5. So in essence, specifying a ToolsVersion value at the command line is essentially equivalent to choosing from a predefined set of valid values for $(MSBuildBinPath). So specifying a ToolsVersion of 2.0 will cause MSBuildBinPath to evaluate to the .NET Framework 2.0 install path, and 3.5 will cause it to evaluate to the .NET Framework 3.5 install path, etc. Additionally, the targets that ship in MSBuild 3.5 include enhancements to the build process that will cause it to use the new set of compilers and other tasks.&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color=#0000ff size=2&gt;&lt;SPAN style="FONT-SIZE: 11pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Courier New'; mso-fareast-font-family: Calibri; mso-fareast-theme-font: minor-latin; mso-ansi-language: EN-US; mso-fareast-language: EN-US; mso-bidi-language: AR-SA"&gt;&lt;FONT face=Arial color=#000000 size=2&gt;&lt;STRONG&gt;MSBuildBinPath&lt;/STRONG&gt;&amp;nbsp;has also been "deprecated"&amp;nbsp;in&amp;nbsp;favor of &lt;STRONG&gt;MSBuildToolsPath&lt;/STRONG&gt; - new projects created will use MSBuildToolsPath since that is a better name for what the property represents.&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color=#0000ff size=2&gt;&lt;SPAN style="FONT-SIZE: 11pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Courier New'; mso-fareast-font-family: Calibri; mso-fareast-theme-font: minor-latin; mso-ansi-language: EN-US; mso-fareast-language: EN-US; mso-bidi-language: AR-SA"&gt;&lt;FONT face=Arial color=#000000 size=2&gt;Allowing you to specify which toolset to use is only half the story. Multi-Targeting is also about building your code "targeting" a specific version of the framework - for instance, you might want to build your app only so that it relies on 2.0 assemblies and not on any 3.0 or 3.5 assemblies. This is done using another lever that is available&amp;nbsp;via your project file. You can include a property in your project file known as &lt;STRONG&gt;TargetFrameworkVersion&lt;/STRONG&gt; that specifies which target framework you are building your application for. TargetFrameworkVersion can either be &lt;STRONG&gt;v2.0&lt;/STRONG&gt;,&lt;STRONG&gt; v3.0&lt;/STRONG&gt; or&lt;STRONG&gt; v3.5&lt;/STRONG&gt; - this means that if you are referencing assemblies that are not in a given TargetFrameworkVersion, then you will get errors/warnings at build time that will tell you so. This prevents you from taking on dependencies that will surprise you when you later turn around and try to deploy your app in a more tightly controlled environment that might only have a smaller subset of the three frameworks installed. Since TargetFrameworkVersion is a new concept, you need to be using ToolsVersion 3.5 in order to succefully build projects while honoring the TargetFrameworkVersion property. &lt;/FONT&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color=#0000ff size=2&gt;&lt;SPAN style="FONT-SIZE: 11pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Courier New'; mso-fareast-font-family: Calibri; mso-fareast-theme-font: minor-latin; mso-ansi-language: EN-US; mso-fareast-language: EN-US; mso-bidi-language: AR-SA"&gt;&lt;FONT face=Arial color=#000000 size=2&gt;This is a confusing topic, so please feel free to ask questions, and provide feedback so that we can help clarify anything on the subject. &lt;/FONT&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color=#0000ff size=2&gt;&lt;SPAN style="FONT-SIZE: 11pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Courier New'; mso-fareast-font-family: Calibri; mso-fareast-theme-font: minor-latin; mso-ansi-language: EN-US; mso-fareast-language: EN-US; mso-bidi-language: AR-SA"&gt;&lt;FONT face=Arial color=#000000 size=2&gt;[ Author : Faisal Mohamood ]&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Arial size=2&gt;&lt;SPAN style="FONT-SIZE: 11pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Courier New'; mso-fareast-font-family: Calibri; mso-fareast-theme-font: minor-latin; mso-ansi-language: EN-US; mso-fareast-language: EN-US; mso-bidi-language: AR-SA"&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&amp;nbsp;&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=1079050" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/msbuild/archive/tags/Faisal+Mohamood/default.aspx">Faisal Mohamood</category><category domain="http://blogs.msdn.com/msbuild/archive/tags/Futures/default.aspx">Futures</category><category domain="http://blogs.msdn.com/msbuild/archive/tags/MSBuild+in+Visual+Studio/default.aspx">MSBuild in Visual Studio</category></item><item><title>MSBuild / Visual Studio aware error messages and message formats</title><link>http://blogs.msdn.com/msbuild/archive/2006/11/03/msbuild-visual-studio-aware-error-messages-and-message-formats.aspx</link><pubDate>Fri, 03 Nov 2006 03:17:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:937727</guid><dc:creator>msbuild</dc:creator><slash:comments>20</slash:comments><comments>http://blogs.msdn.com/msbuild/comments/937727.aspx</comments><wfw:commentRss>http://blogs.msdn.com/msbuild/commentrss.aspx?PostID=937727</wfw:commentRss><description>&lt;P&gt;MSBuild recognizes error messages and warnings that have been specially formatted by many command line tools that typically write to the console. For instance, take a look at the following error messages - they are all properly formatted to be MSBuild and Visual Studio friendly.&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Main.cs(17,20): warning CS0168: The variable 'foo' is declared but never used &lt;?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; C:\dir1\foo.resx(2) : error BC30188: Declaration expected.&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; cl : Command line warning D4024 : unrecognized source file type 'foo.cs', object file assumed&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; error CS0006: Metadata file 'System.dll' could not be found.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;&lt;/SPAN&gt;&amp;nbsp;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;&lt;FONT face=Arial&gt;These messages&amp;nbsp;confirm to&amp;nbsp;special format that is shown below, and comprise 5 parts - the order of these parts are important and should not change:&lt;/FONT&gt;&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;&lt;FONT face=Arial&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;&lt;IMG style="WIDTH: 728px; HEIGHT: 131px" height=131 src="http://msbuild.members.winisp.net/images/canonical_error_format.png" width=728 mce_src="http://msbuild.members.winisp.net/images/canonical_error_format.png"&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;&lt;FONT face=Arial&gt;&lt;EM&gt;&lt;U&gt;Origin (Required)&lt;/U&gt;&lt;/EM&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;&lt;FONT face=Arial&gt;Origin can be blank. If present, the origin is usually a tool name, like 'cl' in one of the examples. But it could also be a filename, like 'Main.cs' shown in another example. If it is a filename, then it must be an absolute or a relative filename, followed by an optional paranthesized line/column information in one of the following forms:&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;&lt;FONT face=Arial&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&amp;nbsp;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;&lt;FONT face=Arial&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; (line) or (line-line) or (line-col) or (line,col-col) or (line,col,line,col)&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;&lt;FONT face=Arial&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&amp;nbsp;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;&lt;FONT face=Arial&gt;Lines and columns start at 1 in a file - i.e. the beginning of a file is 1, and the leftmost column is 1. If the Origin is a tool name, then it must not change based on local - i.e. it needs to be locale neutral.&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;&lt;FONT face=Arial&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&amp;nbsp;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;&lt;FONT face=Arial&gt;&lt;EM&gt;&lt;U&gt;Subcategory (Optional)&lt;/U&gt;&lt;/EM&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;&lt;FONT face=Arial&gt;Subcategory is used to classify the category itself further, and should not be localized.&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;&lt;FONT face=Arial&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&amp;nbsp;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;&lt;FONT face=Arial&gt;&lt;EM&gt;&lt;U&gt;Category (Required)&lt;/U&gt;&lt;/EM&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;&lt;FONT face=Arial&gt;Category must be either 'error' or 'warning'. Case does not matter. Like origin, category must not be localized.&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;&lt;FONT face=Arial&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&amp;nbsp;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;&lt;FONT face=Arial&gt;&lt;EM&gt;&lt;U&gt;Code (Required)&lt;/U&gt;&lt;/EM&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;&lt;FONT face=Arial&gt;Code identifies an application specific error code / warning code. Code must not be localized and it must not contain spaces.&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;&lt;FONT face=Arial&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&amp;nbsp;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;&lt;FONT face=Arial&gt;&lt;EM&gt;&lt;U&gt;Text (Optional)&lt;/U&gt;&lt;/EM&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;&lt;FONT face=Arial&gt;User friendly text that explains the error, and&amp;nbsp;*must* be localized if you cater to multiple locales.&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;&lt;FONT face=Arial&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&amp;nbsp;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;&lt;FONT face=Arial&gt;&lt;STRONG&gt;So, how does MSBuild use Errors and Warnings emitted by external tools?&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;&lt;FONT face=Arial&gt;When MSBuild calls command line tools (for instance, csc.exe or vbc.exe), it looks at the output emitted by the tool to standard out / standard error streams. Any lines that match the error format that I just described will be treated specially - i.e. lines that are recognized as errors or warnings will be turned into build errors and warnings respectively.&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;&lt;FONT face=Arial&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&amp;nbsp;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;&lt;FONT face=Arial&gt;&lt;STRONG&gt;So, what's the big deal about this anyway? (Here comes the really cool part) :)&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;&lt;FONT face=Arial&gt;To see the real benefit of this, you have to be building from within Visual Studio. Because MSBuild treats these messages specially, they get logged as first class warnings and errors in the Visual Studio task list. If the Origin specifies line/column information, then double clicking on the message will take you to the source of the error in the offending file.&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;&lt;FONT face=Arial&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&amp;nbsp;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;&lt;FONT face=Arial&gt;[ Author : Faisal Mohamood ]&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=937727" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/msbuild/archive/tags/Faisal+Mohamood/default.aspx">Faisal Mohamood</category><category domain="http://blogs.msdn.com/msbuild/archive/tags/MSBuild+in+Visual+Studio/default.aspx">MSBuild in Visual Studio</category></item><item><title>/p property values are immutable - (sort of)....</title><link>http://blogs.msdn.com/msbuild/archive/2006/10/05/_2F00_p-property-values-are-immutable-_2D00_-_2800_sort-of_29002E002E002E002E00_.aspx</link><pubDate>Thu, 05 Oct 2006 18:55:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:794206</guid><dc:creator>msbuild</dc:creator><slash:comments>6</slash:comments><comments>http://blogs.msdn.com/msbuild/comments/794206.aspx</comments><wfw:commentRss>http://blogs.msdn.com/msbuild/commentrss.aspx?PostID=794206</wfw:commentRss><description>&lt;P&gt;Hello there - sorry for the long absence, but we're back and hopefully I'll keep this going again.&lt;/P&gt;
&lt;P&gt;So there was a recent forum post about how property values that are specified from the command line are immutable - i.e. it is not straightforward to change them from within the project file. Well, this is mostly true, but there are exceptions.&lt;/P&gt;
&lt;P&gt;Let's take an example:&lt;/P&gt;
&lt;P&gt;If I've got a property in my project file defined like this,&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 8pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 8pt; COLOR: #a31515; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;PropertyGroup&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 8pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&amp;gt;&lt;?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 8pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 8pt; COLOR: #a31515; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;Configuration&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 8pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&amp;gt;&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 8pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;Debug&lt;SPAN style="COLOR: blue"&gt;&amp;lt;/&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;Configuration&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 8pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&amp;lt;/&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 8pt; COLOR: #a31515; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;PropertyGroup&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 8pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&amp;gt;&lt;/SPAN&gt;&lt;FONT color=#0000ff size=2&gt;&lt;/P&gt;&lt;/FONT&gt;&lt;SPAN style="FONT-SIZE: 9pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Courier New'"&gt;&lt;FONT color=#0000ff size=2&gt;&lt;/FONT&gt;
&lt;P&gt;&lt;FONT color=#0000ff size=2&gt;&lt;/P&gt;&lt;/FONT&gt;&lt;/SPAN&gt;then, calling msbuild with /p:Configuration=Release will override this value (or alternatively set the value if it is not defined) for all projects that are being built. Properties that we pass in with a /p switch on the command line are known as "Global Properties" and so it will flow down to all projects that are being built - so if you were building a solution file, all projects will get the overridden value of this property. 
&lt;P&gt;Now, let's say that you have this defined in your project file:&lt;/P&gt;&lt;SPAN style="FONT-SIZE: 8pt; FONT-FAMILY: 'Courier New'; mso-bidi-font-size: 10.0pt"&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 8pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 8pt; COLOR: #a31515; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;PropertyGroup&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 8pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 8pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 8pt; COLOR: #a31515; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;AppPath&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 8pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt; &lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 8pt; COLOR: red; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;Condition&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 8pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;=&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 8pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;"&lt;SPAN style="COLOR: blue"&gt; '$(AppPath)' == '' &lt;/SPAN&gt;"&lt;SPAN style="COLOR: blue"&gt;&amp;gt;&lt;/SPAN&gt;bin\debug\&lt;SPAN style="COLOR: blue"&gt;&amp;lt;/&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;AppPath&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 8pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 8pt; COLOR: #a31515; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;AppPath&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 8pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt; &lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 8pt; COLOR: red; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;Condition&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 8pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;=&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 8pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;"&lt;SPAN style="COLOR: blue"&gt; !HasTrailingSlash('$(AppPath)') &lt;/SPAN&gt;"&lt;SPAN style="COLOR: blue"&gt;&amp;gt;&lt;/SPAN&gt;$(AppPath)\&lt;SPAN style="COLOR: blue"&gt;&amp;lt;/&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;AppPath&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 8pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&amp;lt;/&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 8pt; COLOR: #a31515; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;PropertyGroup&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 8pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/SPAN&gt;
&lt;P&gt;What I am doing here is that I am defining a default value for AppPath property if AppPath is not defined. Additionally, I want to set it up so that if someone has specified an AppPath property, then if it does not already have a trailing slash, I'd like to add it. Looks reasonable, correct?&lt;/P&gt;
&lt;P&gt;Actually this will not work as you expect - and is something to watch out for. What happens when you specify something with a &lt;STRONG&gt;/p:AppPath=blah\&lt;/STRONG&gt; is that all in-project property definitions for AppPath are ignored&amp;nbsp;(or essentially overridden), and so none of the in-project property definitions take effect - even the ones with the condition. This makes sense if you think about it because otherwise what exactly are we supposed to override? Would that be the first definition of the property? Or should we override only those values of the property that are checking against an empty value? There isn't a clear answer. We override all property definitions and what is passed in is the effective value.&lt;/P&gt;
&lt;P&gt;Fortunately, there is a way around this if it causes you grief - but it isn't declarative like PropertyGroup. You have to use the CreateProperty task inside a target where you intend to process the property, like so:&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 8pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 8pt; COLOR: #a31515; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;CreateProperty&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 8pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt; &lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 8pt; COLOR: red; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;Value&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 8pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;=&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 8pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;"&lt;SPAN style="COLOR: blue"&gt;$(AppPath)\&lt;/SPAN&gt;"&lt;SPAN style="COLOR: blue"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: red"&gt;Condition&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;=&lt;/SPAN&gt;"&lt;SPAN style="COLOR: blue"&gt; !HasTrailingSlash('$(AppPath)') &lt;/SPAN&gt;"&lt;SPAN style="COLOR: blue"&gt;&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 8pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 8pt; COLOR: #a31515; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;Output&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 8pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt; &lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 8pt; COLOR: red; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;TaskParameter&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 8pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;=&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 8pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;"&lt;SPAN style="COLOR: blue"&gt;Value&lt;/SPAN&gt;"&lt;SPAN style="COLOR: blue"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: red"&gt;PropertyName&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;=&lt;/SPAN&gt;"&lt;SPAN style="COLOR: blue"&gt;AppPath&lt;/SPAN&gt;"&lt;SPAN style="COLOR: blue"&gt; /&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 8pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&amp;lt;/&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 8pt; COLOR: #a31515; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;CreateProperty&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 8pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;Alternatively (and perhaps as a&amp;nbsp;better approach), you can use a property name like AppPath as the public property you expect to override from th command line, but filter it out into a different property inside your targets that you then use for doing the actual work - like this:&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 8pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 8pt; COLOR: #a31515; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;PropertyGroup&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 8pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 8pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 8pt; COLOR: #a31515; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;_validatedAppPath&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 8pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&amp;gt;&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 8pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;$(AppPath)&lt;SPAN style="COLOR: blue"&gt;&amp;lt;/&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;_validatedAppPath&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 8pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 8pt; COLOR: #a31515; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;_validatedAppPath&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 8pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt; &lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 8pt; COLOR: red; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;Condition&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 8pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;=&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 8pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;"&lt;SPAN style="COLOR: blue"&gt; '$(_validatedAppPath)' == '' &lt;/SPAN&gt;"&lt;SPAN style="COLOR: blue"&gt;&amp;gt;&lt;/SPAN&gt;bin\debug\&lt;SPAN style="COLOR: blue"&gt;&amp;lt;/&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;_validatedAppPath&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 8pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 8pt; COLOR: #a31515; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;_validatedAppPath&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 8pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt; &lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 8pt; COLOR: red; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;Condition&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 8pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;=&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 8pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;"&lt;SPAN style="COLOR: blue"&gt; !HasTrailingSlash('$(_validatedAppPath)') &lt;/SPAN&gt;"&lt;SPAN style="COLOR: blue"&gt;&amp;gt;&lt;/SPAN&gt;$(_validatedAppPath)\&lt;SPAN style="COLOR: blue"&gt;&amp;lt;/&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;_validatedAppPath&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 8pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&amp;lt;/&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 8pt; COLOR: #a31515; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;PropertyGroup&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 8pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P mce_keep="true"&gt;In this case, you validate the /p value and store it in an internal property that is validated, and never directly overridden from the command line.&lt;/P&gt;
&lt;P mce_keep="true"&gt;Hope this helps, and clears some confusion on "strange behavior" if you ever encountered it.&lt;/P&gt;
&lt;P mce_keep="true"&gt;[ Author: Faisal Mohamood ]&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=794206" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/msbuild/archive/tags/Faisal+Mohamood/default.aspx">Faisal Mohamood</category><category domain="http://blogs.msdn.com/msbuild/archive/tags/How+To/default.aspx">How To</category><category domain="http://blogs.msdn.com/msbuild/archive/tags/Known+Issues/default.aspx">Known Issues</category></item><item><title>New Feature Feedback Request: /IgnoreProjectExtensions - A new command-line switch</title><link>http://blogs.msdn.com/msbuild/archive/2006/03/24/559547.aspx</link><pubDate>Fri, 24 Mar 2006 04:53:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:559547</guid><dc:creator>msbuild</dc:creator><slash:comments>11</slash:comments><comments>http://blogs.msdn.com/msbuild/comments/559547.aspx</comments><wfw:commentRss>http://blogs.msdn.com/msbuild/commentrss.aspx?PostID=559547</wfw:commentRss><description>&lt;P&gt;I've been in a cave just getting things done toward our Orcas release. But there's not much a Program Manager can do without going back to their customers :) So here I am.&lt;/P&gt;
&lt;P&gt;So here's the scoop.&amp;nbsp; We've been debating internally about a&amp;nbsp;new command line switch on msbuild.exe for sometime now. I am not certain that we've come to the right answer ourselves&amp;nbsp;- but&amp;nbsp;customers give us&amp;nbsp;the final word - so tell us what you think about the following:&lt;/P&gt;
&lt;P&gt;Today, when you invoke msbuild.exe from the command line and don't specify any project files as arguments, then we do some auto inferral and scanning and decide if we should build anything. If we find either a msbuild project (anything that has an extension of *proj) or a solution file (.sln),&amp;nbsp;we will build&amp;nbsp;either the project or the solution as long as there is only one solution or one project in the directory. If there is a solution and a project, we will give preference to the solution.&amp;nbsp; If there's more than one project or more than one solution, we issue an error message because we can't decide which one to build.&lt;/P&gt;
&lt;P&gt;Now, what if you wanted to pick the project instead when a solution is encountered, but didn't want to specify the project name as an argument? Old habits die hard - when building Visual Studio code, we are used to issuing a single command to build the current project instead of having to specify the project name that we are specifying. So the only way to get this to work was to think of supporting a /IgnoreProjectExtensions switch that has the following usage model:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;FONT face="Courier New"&gt;msbuild /IgnoreProjectExtensions:vcproj;sln&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;Now how exactly does this simplify our lives, you ask?&amp;nbsp; We would use a .rsp file that sits next to msbuild.exe that we will add in our environment - after which, simply issuing msbuild will ignore what we ask it to ignore in the solution file.&lt;/P&gt;
&lt;P&gt;What do you think? Something you'd find useful?&amp;nbsp; Or would you rather prefer the "clean" command line interface that we have today, and don't think this switch is worth it? The internal debate is about the fact that we don't want to add command line switch after command line switch to msbuild.exe as we please unless there is a specific customer scenario that we are trying to enable.&amp;nbsp; But DevDiv build is also one of our biggest internal customers :) So we look to you to tell us!&lt;/P&gt;
&lt;P&gt;Cheers.&lt;/P&gt;
&lt;P&gt;[Author: Faisal Mohamood]&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=559547" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/msbuild/archive/tags/Faisal+Mohamood/default.aspx">Faisal Mohamood</category><category domain="http://blogs.msdn.com/msbuild/archive/tags/Futures/default.aspx">Futures</category></item><item><title>How To: Implementing Custom Tasks - Part I</title><link>http://blogs.msdn.com/msbuild/archive/2006/01/21/515834.aspx</link><pubDate>Sun, 22 Jan 2006 02:01:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:515834</guid><dc:creator>msbuild</dc:creator><slash:comments>51</slash:comments><comments>http://blogs.msdn.com/msbuild/comments/515834.aspx</comments><wfw:commentRss>http://blogs.msdn.com/msbuild/commentrss.aspx?PostID=515834</wfw:commentRss><description>&lt;P&gt;While MSBuild is all about build customization,we never really blogged about what is involved in implementing custom tasks.&amp;nbsp; Partly, I suppose that's because implementing a custom task is as easy as falling off a log most of the time: 1) Subclass &lt;A href="http://msdn2.microsoft.com/en-us/library/microsoft.build.utilities.task.aspx"&gt;Microsoft.Build.Utilities.Task&lt;/A&gt; abstract class 2) Implement the &lt;A href="http://msdn2.microsoft.com/en-us/library/microsoft.build.utilities.task.execute.aspx"&gt;Execute&lt;/A&gt; method&lt;/P&gt;
&lt;P&gt;But there's a lot more to tasks than just that. In this series of posts, I hope to cover all there is to know about MSBuild tasks - both at a conceptual level as well as on variations such as &lt;A href="http://msdn2.microsoft.com/en-us/library/ms126394(en-us,VS.80).aspx"&gt;ToolTask&lt;/A&gt;, &lt;A href="http://msdn2.microsoft.com/en-us/library/ms126182(en-us,VS.80).aspx"&gt;AppDomainIsolatedTask&lt;/A&gt;, etc.&amp;nbsp; In this post I'd like to set the context for discussing some of those topics.&lt;/P&gt;
&lt;P&gt;A task, in principle is nothing more than an implementation of the GoF &lt;A href="http://c2.com/cgi/wiki?CommandObject"&gt;Command&lt;/A&gt; Object Pattern i.e.&amp;nbsp;an object that knows how to perform an action encapsulated via an Execute method. While it is possible to utilize tasks programmatically via code, the primary motivation was to provide a way of performing self standing units of work within build targets.&lt;/P&gt;
&lt;P&gt;In the crudest form, a task is a type that implements the &lt;A href="http://msdn2.microsoft.com/en-us/library/microsoft.build.framework.itask.aspx"&gt;Microsoft.Build.Framework.ITask&lt;/A&gt; interface from the Microsoft.Build.Framework assembly.&amp;nbsp; Here's a simple implementation of a task that can set environment variables.&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size=2&gt;using Microsoft.Build.Framework;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size=2&gt;namespace SimpleTask&lt;BR&gt;{&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; public class SetEnvironmentVariable : ITask&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; private IBuildEngine engine;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; public IBuildEngine BuildEngine&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; get { return engine; }&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; set { engine = value; }&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size=2&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; private ITaskHost host;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; public ITaskHost HostObject&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; get { return host; }&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; set { host = value; }&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size=2&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; private string name;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; [Required]&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; public string Name&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; get { return name; }&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; set { name = value; }&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size=2&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; private string varValue;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size=2&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; [Required]&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; public string Value&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; get { return varValue; }&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; set { varValue = value; }&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size=2&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; public bool Execute()&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; System.Environment.SetEnvironmentVariable(name, varValue);&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; string message = string.Format("Environment Variable {0} set to {1}", name, varValue);&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; BuildMessageEventArgs args = new BuildMessageEventArgs(&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; message, string.Empty, "SetEnvironmentVariable", MessageImportance.Normal);&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; engine.LogMessageEvent(args);&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; return true;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;BR&gt;}&lt;BR&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size=1&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;In addition to the Execute method that performs the actual work, at the minimum all tasks must expose two properties - BuildEngine of type &lt;A href="http://msdn2.microsoft.com/en-us/library/microsoft.build.framework.ibuildengine.aspx"&gt;IBuildEngine&lt;/A&gt;, and HostObject of type &lt;A href="http://msdn2.microsoft.com/en-us/library/microsoft.build.framework.itaskhost.aspx"&gt;ITaskHost&lt;/A&gt;. For the purposes of most tasks, the implementation I have shown here will suffice. &lt;/P&gt;
&lt;P&gt;IBuildEngine itself is used by the task to report messages, warnings and errors to the MSBuild engine.&amp;nbsp; ITaskHost is an interface that is used to represent host objects that can form a basis for richer communication between tasks and an environment that hosts MSBuild (such as Visual Studio).&amp;nbsp; ITaskHost is extremely useful in cases where you are hosting the build engine yourself.&amp;nbsp; I will cover the details of this beast in a later post.&lt;/P&gt;
&lt;P&gt;.NET properties on a task type allow you define&amp;nbsp;parameters on the task in order&amp;nbsp;to communicate with the task via the project file.&amp;nbsp; So, in the case of the SetEnvironmentVariable task, I have defined Name and Value properties as inputs into the task. My use of the &lt;A href="http://msdn2.microsoft.com/en-us/library/microsoft.build.framework.requiredattribute.aspx"&gt;Required&lt;/A&gt; attribute on these two properties ensures that the invocation of the tasks will not be possible without specifying those two parameters. In this context, it makes sense because the task cannot perform its function without having those to values specified to it.&lt;/P&gt;
&lt;P&gt;Finally, returning true from the Execute method indicates success to the MSBuild engine. I have ignored the possibility of the task failing in this case to keep it simple - look for more details on this subject alone in a subsequent post.&lt;/P&gt;
&lt;P&gt;Here's how the task is invoked from a project file:&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" color=#000000 size=2&gt;&amp;lt;Project xmlns="&lt;/FONT&gt;&lt;A href="http://schemas.microsoft.com/developer/msbuild/2003"&gt;&lt;FONT face="Courier New" color=#000000 size=2&gt;http://schemas.microsoft.com/developer/msbuild/2003&lt;/FONT&gt;&lt;/A&gt;&lt;FONT face="Courier New" color=#000000 size=2&gt;"&amp;gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp; &amp;lt;UsingTask AssemblyFile="SimpleTasks.dll" TaskName="SimpleTask.SetEnvironmentVariable" /&amp;gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp; &lt;BR&gt;&amp;nbsp;&amp;nbsp; &amp;lt;PropertyGroup&amp;gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;OutputPath&amp;gt;c:\temp&amp;lt;/OutputPath&amp;gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp; &amp;lt;/PropertyGroup&amp;gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" color=#000000 size=2&gt;&amp;nbsp;&amp;nbsp; &amp;lt;Target Name="MyTarget"&amp;gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;SetEnvironmentVariable Name="OutputPath" value="$(OutputPath)" /&amp;gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp; &amp;lt;/Target&amp;gt;&lt;BR&gt;&amp;lt;/Project&amp;gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;That's all there is to defining and using custom tasks.&amp;nbsp;Of course, it is way simpler to derive from the abstract class Microsoft.Build.Utilities.Task that is included in the Microsoft.Build.Utilities assembly, and that's what you should be using most of the time unless you require a richer interaction with the MSBuild engine.&lt;/P&gt;
&lt;P&gt;In the next post,&amp;nbsp;I will&amp;nbsp;dig into more details on interacting with tasks via the project file. We will examine the types of objects that can be passed in and out of tasks, caveats to watch out for, etc.&lt;/P&gt;
&lt;P&gt;[ Author: Faisal Mohamood ]&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=515834" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/msbuild/archive/tags/Faisal+Mohamood/default.aspx">Faisal Mohamood</category><category domain="http://blogs.msdn.com/msbuild/archive/tags/How+To/default.aspx">How To</category></item><item><title>Platform Sprint 11</title><link>http://blogs.msdn.com/msbuild/archive/2006/01/05/509778.aspx</link><pubDate>Thu, 05 Jan 2006 22:29:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:509778</guid><dc:creator>msbuild</dc:creator><slash:comments>0</slash:comments><comments>http://blogs.msdn.com/msbuild/comments/509778.aspx</comments><wfw:commentRss>http://blogs.msdn.com/msbuild/commentrss.aspx?PostID=509778</wfw:commentRss><description>&lt;P&gt;The new year got off to a good start for us with the MSBuild Platform Sprint 11 Backlog selection meeting.&amp;nbsp;Platform Sprint 10 was focused mostly on getting our Compatibility story in place.&amp;nbsp;All of the work from the last sprint in terms of compatibility has been checked in and is now in use.&lt;/P&gt;
&lt;P&gt;This means that we can finally get to the good stuff in Platform Sprint 11.&amp;nbsp;Our sprint goal for this sprint is to deliver a working version of multi-proc build capability.&amp;nbsp;Needless to say, everyone on the sprint is excited about this and we are looking forward to the end of the month to see where we stand.&amp;nbsp;I believe that we will have good parts of the multi-proc functionality working at the end of the sprint, and here's why:&lt;/P&gt;
&lt;P&gt;Over the past sprints, we have been thinking a lot about the design of the system - like we discussed &lt;a href="http://blogs.msdn.com/msbuild/archive/2005/11/09/491044.aspx"&gt;here&lt;/A&gt; and &lt;a href="http://blogs.msdn.com/msbuild/archive/2005/10/14/481171.aspx"&gt;here&lt;/A&gt;.&amp;nbsp;It is time now to start thinking in terms of real implementation milestones - and to that end we decided to think strictly&amp;nbsp;in terms of &lt;A href="http://www.extremeprogramming.org/rules/userstories.html"&gt;"User Stories"&lt;/A&gt;.&amp;nbsp;So, everything that has to do with multi-proc that went on our backlog were real stories that would make sense to you from a customer standpoint, as opposed to items that are more closely aligned with the design or the implementation of the system.&amp;nbsp;For instance, the simplest user story in our case was&lt;EM&gt; "Build two simple, independent projects in parallel, with no logging support, no disk-bound tasks"&lt;/EM&gt;.&amp;nbsp;You can think of the simple projects as those that have a single target, and a single Message task.&amp;nbsp;That really is our first customer story for multi-proc.&amp;nbsp;We build successively on individual stories till we eventually get to a fully featured multi-proc build functionality.&lt;/P&gt;
&lt;P&gt;Of course there are a lot of other activities going on in this sprint as well.&amp;nbsp;We are working on handful of bugs that we could not get to during the tail end of Whidbey.&amp;nbsp;We are also investing in QA work so that we are able to deliver at an even higher level of quality during Orcas.&lt;/P&gt;
&lt;P&gt;I couldn't have asked for a better start with the new year.&amp;nbsp;I am highly optimistic of everything that is to come in the following months.&amp;nbsp;In the meantime, I encourage you to log any issues you run into with MSBuild via the &lt;A href="http://lab.msdn.microsoft.com/productfeedback/"&gt;MSDN Product Feedback Center&lt;/A&gt; so that we can consider them as bug fixes during the current Platform Sprint 11, or the subsequent one.&lt;/P&gt;
&lt;P&gt;[ Author: Faisal Mohamood ]&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=509778" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/msbuild/archive/tags/Faisal+Mohamood/default.aspx">Faisal Mohamood</category><category domain="http://blogs.msdn.com/msbuild/archive/tags/Agile+Development/default.aspx">Agile Development</category><category domain="http://blogs.msdn.com/msbuild/archive/tags/Futures/default.aspx">Futures</category></item><item><title>Well Known Limitation: Dynamic items and properties not emitted until target execution completes</title><link>http://blogs.msdn.com/msbuild/archive/2006/01/03/508629.aspx</link><pubDate>Tue, 03 Jan 2006 03:46:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:508629</guid><dc:creator>msbuild</dc:creator><slash:comments>8</slash:comments><comments>http://blogs.msdn.com/msbuild/comments/508629.aspx</comments><wfw:commentRss>http://blogs.msdn.com/msbuild/commentrss.aspx?PostID=508629</wfw:commentRss><description>&lt;P&gt;&lt;A href="http://www.sedodream.com/default.aspx"&gt;Sayed Ibrahim Hashimi&lt;/A&gt;&amp;nbsp;has &lt;A href="http://www.sedodream.com/PermaLink,guid,dd6cb1db-c0e4-47f7-ad84-6e59ff6b03d0.aspx"&gt;written about&lt;/A&gt; a restriction that he ran into when using &lt;A href="http://msdn2.microsoft.com/library/63ckb9s9.aspx"&gt;CreateProperty&lt;/A&gt; and &lt;A href="http://msdn2.microsoft.com/library/s2y3e43x.aspx"&gt;CreateItem&lt;/A&gt; tasks to dynamically emit properties and items.&amp;nbsp; The issue has to do with not being able to access items and properties that are created within a target until the target execution actually completes.&lt;/P&gt;
&lt;P&gt;So, if you were to run CreateProperty or CreateItem and immediately execute the &lt;A href="http://msdn2.microsoft.com/ms229474.aspx"&gt;CallTarget&lt;/A&gt; task&amp;nbsp;to invoke another target that needed access either an item or property that was just created, you will be out of luck.&amp;nbsp; We don't publish dynamic properties or items until the target that created them is done executing.&amp;nbsp; This is a known issue for Whidbey.&amp;nbsp; Fortunately the workaround is simple:&amp;nbsp; have one target emit the items/properties and finish execution before you run the next target that uses them.&amp;nbsp; You can sequence the execution of these two targets via a &lt;STRONG&gt;DependsOnTargets&lt;/STRONG&gt; attribute on a master target - alternatively the master target can use CallTarget&amp;nbsp;to invoke both the targets sequentially.&lt;/P&gt;
&lt;P&gt;Thank you Sayed for reporting it via the MSDN Product Feedback Center.&amp;nbsp; We have it on our list of feature items to consider for Orcas, and we will need to either publish items and properties globally even before the target execution completes - or alternatively allow parameter passing into targets.&lt;/P&gt;
&lt;P&gt;Feedback and blogging about these topics just gives us a better idea of the pain points our customers are experiencing today.&amp;nbsp; Thanks for the feedback and continue sending us more.&lt;/P&gt;
&lt;P&gt;[ Author: Faisal Mohamood ]&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=508629" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/msbuild/archive/tags/Faisal+Mohamood/default.aspx">Faisal Mohamood</category><category domain="http://blogs.msdn.com/msbuild/archive/tags/Known+Issues/default.aspx">Known Issues</category></item><item><title>MSBee CTP released</title><link>http://blogs.msdn.com/msbuild/archive/2006/01/02/508607.aspx</link><pubDate>Tue, 03 Jan 2006 00:38:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:508607</guid><dc:creator>msbuild</dc:creator><slash:comments>0</slash:comments><comments>http://blogs.msdn.com/msbuild/comments/508607.aspx</comments><wfw:commentRss>http://blogs.msdn.com/msbuild/commentrss.aspx?PostID=508607</wfw:commentRss><description>&lt;P&gt;&lt;a href="http://blogs.msdn.com/clichten"&gt;Craig&lt;/A&gt; &lt;a href="http://blogs.msdn.com/clichten/archive/2005/12/30/508174.aspx"&gt;points out&lt;/A&gt; that the first CTP for MSBee went out early adopters last week.&amp;nbsp; If you are interested, send an email to &lt;A href="mailto:ddcpxsln@microsoft.com"&gt;ddcpxsln@microsoft.com&lt;/A&gt;&amp;nbsp;and get on the CTP!&lt;/P&gt;
&lt;P&gt;We look forward to your feedback as we continue to work on MSBee in the coming weeks.&lt;/P&gt;
&lt;P&gt;[ Author: Faisal Mohamood ]&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=508607" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/msbuild/archive/tags/Faisal+Mohamood/default.aspx">Faisal Mohamood</category></item><item><title>How To: Customizing Project File Intellisense in Visual Studio</title><link>http://blogs.msdn.com/msbuild/archive/2005/11/08/490462.aspx</link><pubDate>Tue, 08 Nov 2005 21:49:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:490462</guid><dc:creator>msbuild</dc:creator><slash:comments>3</slash:comments><comments>http://blogs.msdn.com/msbuild/comments/490462.aspx</comments><wfw:commentRss>http://blogs.msdn.com/msbuild/commentrss.aspx?PostID=490462</wfw:commentRss><description>&lt;P&gt;So Neil &lt;a href="http://blogs.msdn.com/msbuild/archive/2005/11/04/489212.aspx"&gt;pointed out&lt;/A&gt; that you can find the MSBuild schemas in either the .NET Framework install path, as well as the Visual Studio install location. The one in the Framework folder ships as a reference (since MSBuild really is part of the .NET redist). The one in the Visual Studio install folder &lt;FONT face="Courier New" color=#0000ff size=2&gt;\Program Files\Microsoft Visual Studio 8\xml\Schemas\1033&lt;/FONT&gt; is used by Visual Studio to provide Intellsense support that we all know and love.&amp;nbsp; &lt;/P&gt;
&lt;P&gt;We have designed our schemas to be extensible so that you can add custom Intellisense for your custom properties, items and tasks.&amp;nbsp;&lt;STRONG&gt;Microsoft.Build.xsd&lt;/STRONG&gt; is where you add your customizations. We have commented the file with examples of how to go about adding your own items, properties and tasks to the schema so that you can get Intellisense for your custom types. You could go one step further to keep your definitions separate and more manageable - instead of adding your definitions directly to this file, create a new file (for eg. &lt;STRONG&gt;MyCompany.MSBuildTypes.xsd&lt;/STRONG&gt;) and import it into the &lt;STRONG&gt;Microsoft.Build.xsd&lt;/STRONG&gt;.&lt;/P&gt;
&lt;P&gt;Note that Microsoft.Build.xsd itself is tiny and contains almost no real matter - most of the pre-defined MSBuild types are imported via another schema file i.e. &lt;STRONG&gt;Microsoft.Build.CommonTypes.xsd&lt;/STRONG&gt;.&lt;/P&gt;
&lt;P&gt;[ Author: Faisal Mohamood ]&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=490462" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/msbuild/archive/tags/Faisal+Mohamood/default.aspx">Faisal Mohamood</category><category domain="http://blogs.msdn.com/msbuild/archive/tags/How+To/default.aspx">How To</category></item><item><title>How To: Recursively Copy Files Using the &lt;Copy&gt; Task</title><link>http://blogs.msdn.com/msbuild/archive/2005/11/07/490068.aspx</link><pubDate>Tue, 08 Nov 2005 01:58:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:490068</guid><dc:creator>msbuild</dc:creator><slash:comments>27</slash:comments><comments>http://blogs.msdn.com/msbuild/comments/490068.aspx</comments><wfw:commentRss>http://blogs.msdn.com/msbuild/commentrss.aspx?PostID=490068</wfw:commentRss><description>&lt;FONT color=#0000ff&gt;
&lt;P&gt;&lt;FONT face=Tahoma color=#000000 size=2&gt;Have you ever run into a situation where you had to recursively copy files from one folder into another as a part of your build process?&amp;nbsp; We certainly have run into it a few times, and I thought I'd share with you a neat trick that involves the use of metadata and the Copy task.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Tahoma color=#000000 size=2&gt;Before you can copy a set of files, you need to be able to recursively add those files to an item list.&amp;nbsp;Here's how you do that when declaring items.&lt;/FONT&gt;&lt;FONT color=#0000ff&gt;&lt;FONT face="Courier New"&gt;&lt;FONT color=#0000ff&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT size=2&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#800000 size=2&gt;ItemGroup&lt;/FONT&gt;&lt;FONT color=#0000ff&gt;&lt;FONT size=2&gt;&amp;gt;&lt;BR&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;&lt;FONT color=#800000&gt;Compile&lt;/FONT&gt;&lt;FONT color=#0000ff&gt; &lt;/FONT&gt;&lt;FONT color=#ff0000&gt;Include&lt;/FONT&gt;&lt;FONT color=#0000ff&gt;=&lt;/FONT&gt;&lt;FONT color=#000000&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff&gt;.\**\*.cs&lt;/FONT&gt;&lt;FONT color=#000000&gt;" /&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff&gt;&lt;FONT size=2&gt;&amp;gt;&amp;nbsp;&lt;BR&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;&lt;FONT color=#0000ff&gt;&amp;lt;/&lt;/FONT&gt;&lt;FONT color=#800000&gt;ItemGroup&lt;/FONT&gt;&lt;FONT color=#0000ff&gt;&amp;gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color=#0000ff&gt;&lt;FONT face=Tahoma color=#000000 size=2&gt;The ** wildcard is used in item includes to indicate recursive includes.&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Tahoma color=#000000 size=2&gt;So, once you have an item declared as such, you can rely on a piece of standard meta-data that goes with all items (i.e. RecursiveDir) to accomplish your recursive copy.&amp;nbsp;The RecursiveDir metadata when used will return the evaluated value of the ** metadata for each item - and you can use that value to preserve the folder structure for each file when performing the copy.&amp;nbsp;Here's how you invoke the &amp;lt;Copy&amp;gt; task using this piece of metadata to copy recursively.&lt;/FONT&gt;&lt;/P&gt;&lt;FONT color=#0000ff&gt;
&lt;P&gt;&lt;FONT size=2&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;&lt;FONT color=#800000&gt;Copy&lt;/FONT&gt;&lt;FONT color=#0000ff&gt; &lt;/FONT&gt;&lt;FONT color=#ff0000&gt;SourceFiles&lt;/FONT&gt;&lt;FONT color=#0000ff&gt;=&lt;/FONT&gt;&lt;FONT color=#000000&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff&gt;@(Compile)&lt;/FONT&gt;&lt;FONT color=#000000&gt;" &lt;/FONT&gt;&lt;FONT color=#ff0000&gt;DestinationFolder&lt;/FONT&gt;&lt;FONT color=#0000ff&gt;=&lt;/FONT&gt;&lt;FONT color=#000000&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff&gt;c:\foocopy\%(RecursiveDir)&lt;/FONT&gt;&lt;FONT color=#000000&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff&gt;&amp;gt;&amp;lt;/&lt;/FONT&gt;&lt;FONT color=#800000&gt;Copy&lt;/FONT&gt;&lt;FONT color=#0000ff&gt;&amp;gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color=#0000ff&gt;&lt;FONT face=Tahoma color=#000000 size=2&gt;Hope this helps!&amp;nbsp;Let us know if these tips/tricks and how-tos are useful.&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color=#0000ff&gt;&lt;FONT face=Tahoma color=#000000 size=2&gt;[ Author: Faisal Mohamood ]&lt;/FONT&gt;&lt;/P&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=490068" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/msbuild/archive/tags/Faisal+Mohamood/default.aspx">Faisal Mohamood</category><category domain="http://blogs.msdn.com/msbuild/archive/tags/How+To/default.aspx">How To</category></item><item><title>HOW TO: Beyond PreBuild and PostBuild Steps</title><link>http://blogs.msdn.com/msbuild/archive/2005/10/12/480212.aspx</link><pubDate>Wed, 12 Oct 2005 21:43:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:480212</guid><dc:creator>msbuild</dc:creator><slash:comments>4</slash:comments><comments>http://blogs.msdn.com/msbuild/comments/480212.aspx</comments><wfw:commentRss>http://blogs.msdn.com/msbuild/commentrss.aspx?PostID=480212</wfw:commentRss><description>&lt;P&gt;Do you use PreBuild and PostBuild steps that are provided in the IDE?&amp;nbsp;You will find that they are still available in Visual Studio 2005 - but from within the IDE, you only get the ability to run command line batch files / scripts.&amp;nbsp;Essentially, prebuild and postbuild steps get executed using the &lt;FONT face="Courier New"&gt;&lt;STRONG&gt;&amp;lt;Exec&amp;gt;&lt;/STRONG&gt;&lt;/FONT&gt; task.&lt;/P&gt;
&lt;P&gt;It's all well and good - except we already provide a rich set of tasks for you to use so that you have more flexibility and control over your build.&amp;nbsp;For instance, using the &lt;FONT face="Courier New"&gt;&lt;STRONG&gt;&amp;lt;Copy&amp;gt;&lt;/STRONG&gt;&lt;/FONT&gt; task instead of the copy command gives you richer programmatic control over that step.&amp;nbsp;So, what if you wanted to implement PreBuild and PostBuild using MSBuild tasks?&lt;/P&gt;
&lt;P&gt;Open up your project file for edit (using the supercool tip I &lt;a href="http://blogs.msdn.com/msbuild/archive/2005/09/29/475164.aspx"&gt;&lt;STRONG&gt;mentioned&lt;/STRONG&gt;&lt;/A&gt; earlier).&amp;nbsp;You will see that all Visual Studio projects have two targets that are commented out - &lt;FONT face="Courier New"&gt;&lt;STRONG&gt;&amp;lt;BeforeBuild&amp;gt;&lt;/STRONG&gt;&lt;/FONT&gt; and &lt;FONT face="Courier New"&gt;&lt;STRONG&gt;&amp;lt;AfterBuild&amp;gt;&lt;/STRONG&gt;&lt;/FONT&gt;.&amp;nbsp;All you need to do is really have targets with those names in your project (we call it target overriding - because those targets are actually pre-defined in the &lt;FONT face="Courier New"&gt;&lt;STRONG&gt;Microsoft.Common.targets&lt;/STRONG&gt;&lt;/FONT&gt; file that contains the Visual Studio Build process). So it's these targets that will allow you to implement your pre-build and post-build steps using MSBuild tasks instead of relying on command line scripts.&lt;/P&gt;
&lt;P&gt;Here's an example of how it would look in the project file:&lt;/P&gt;&lt;FONT color=#0000ff size=2&gt;
&lt;P&gt;&lt;FONT face="Courier New"&gt;&amp;lt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face="Courier New"&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;BeforeBuild&lt;/FONT&gt;&lt;FONT size=2&gt;"&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face="Courier New"&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;This is the BeforeBuild target&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;Importance&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;normal&lt;/FONT&gt;&lt;FONT size=2&gt;"&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face="Courier New"&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=#008000 size=2&gt; Insert other tasks to run before build here &lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face="Courier New"&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;Target&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face="Courier New"&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;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;AfterBuild&lt;/FONT&gt;&lt;FONT size=2&gt;"&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face="Courier New"&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;This is the AfterBuild target&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;Importance&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;normal&lt;/FONT&gt;&lt;FONT size=2&gt;"&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face="Courier New"&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=#008000 size=2&gt; Insert other tasks to run after build here &lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face="Courier New"&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;Target&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&amp;gt;&lt;/P&gt;&lt;/FONT&gt;&lt;/FONT&gt;
&lt;P&gt;[Author: Faisal Mohamood]&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=480212" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/msbuild/archive/tags/Faisal+Mohamood/default.aspx">Faisal Mohamood</category><category domain="http://blogs.msdn.com/msbuild/archive/tags/How+To/default.aspx">How To</category></item><item><title>Are you new to MSBuild?  Check out our Hands-On-Lab</title><link>http://blogs.msdn.com/msbuild/archive/2005/10/11/479744.aspx</link><pubDate>Tue, 11 Oct 2005 22:05:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:479744</guid><dc:creator>msbuild</dc:creator><slash:comments>7</slash:comments><comments>http://blogs.msdn.com/msbuild/comments/479744.aspx</comments><wfw:commentRss>http://blogs.msdn.com/msbuild/commentrss.aspx?PostID=479744</wfw:commentRss><description>&lt;P&gt;This &lt;A href="http://msbuild.members.winisp.net/documents/HOL_MSBuild.doc"&gt;MSBuild Hands-On-Lab&lt;/A&gt; introduces you to the fundamentals of MSBuild.&amp;nbsp; It talks about the basics such as how to hand-author a simple MSBuild project file, and then builds on that to show you how to take it all the way to more advanced aspects such as incremental builds and target level dependency analysys (TLDA), authoring custom tasks, Visual Studio and how it relates to MSBuild, how Visual Studio integrates MSBuild, and all that good stuff.&amp;nbsp; Check it out!&lt;/P&gt;
&lt;P&gt;[Author: Faisal Mohamood]&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=479744" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/msbuild/archive/tags/Faisal+Mohamood/default.aspx">Faisal Mohamood</category></item><item><title>PDC Session Slide Decks are Online</title><link>http://blogs.msdn.com/msbuild/archive/2005/10/11/479723.aspx</link><pubDate>Tue, 11 Oct 2005 21:26:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:479723</guid><dc:creator>msbuild</dc:creator><slash:comments>2</slash:comments><comments>http://blogs.msdn.com/msbuild/comments/479723.aspx</comments><wfw:commentRss>http://blogs.msdn.com/msbuild/commentrss.aspx?PostID=479723</wfw:commentRss><description>&lt;P&gt;The slide-decks for the two MSBuild talks we presented at the conference have been available on-line for a while now.&amp;nbsp; Check them out:&amp;nbsp;&lt;A href="http://216.55.183.63/pdc2005/slides/TLN402_Goel.ppt"&gt;MSBuild - Architecting a Custom Build System by Rajeev Goel&lt;/A&gt;&amp;nbsp;and &lt;A href="http://216.55.183.63/pdc2005/slides/TLNL01_Mohamood.ppt"&gt;MSBuild - Tips &amp;amp; Tricks by Faisal Mohamood&lt;/A&gt;&amp;nbsp;are both available.&lt;/P&gt;
&lt;P&gt;[Author: Faisal Mohamood]&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=479723" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/msbuild/archive/tags/Faisal+Mohamood/default.aspx">Faisal Mohamood</category></item><item><title>Editing MSBuild project files in Visual Studio</title><link>http://blogs.msdn.com/msbuild/archive/2005/09/29/475164.aspx</link><pubDate>Thu, 29 Sep 2005 04:50:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:475164</guid><dc:creator>msbuild</dc:creator><slash:comments>12</slash:comments><comments>http://blogs.msdn.com/msbuild/comments/475164.aspx</comments><wfw:commentRss>http://blogs.msdn.com/msbuild/commentrss.aspx?PostID=475164</wfw:commentRss><description>&lt;P&gt;Being able to edit your Visual Studio generated projects is one of the fundamental goals of MSBuild.&amp;nbsp; Being able to edit your project file to customize and extend is not something that just happened to work&amp;nbsp;:) MSBuild and Visual Studio 2005 were designed right from the start to enable you to do this.&amp;nbsp; If you ask me, this is the "essence of MSBuild"&lt;/P&gt;
&lt;P&gt;So let's say you are working on your project, and have your project loaded in the IDE - What's the easiest way for you to be able to quickly drop into the MSBuild project file (either .csproj or .vbproj) so that you can edit the project to customize your build?&lt;/P&gt;
&lt;P&gt;Pretty simple - if you are using one of the builds past the June CTP, you can do this in two steps.&lt;/P&gt;
&lt;P&gt;1. Right click on your project in solution explorer and select &lt;STRONG&gt;Unload Project&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;2. Right click on the project (tagged as unavailable in solution explorer) and click "&lt;STRONG&gt;Edit &lt;/STRONG&gt;yourproj.csproj"&lt;/P&gt;
&lt;P&gt;It's that simple.&amp;nbsp; No more notepad.&amp;nbsp; No more File-&amp;gt;Open-&amp;gt;blah-&amp;gt;blah-&amp;gt;blah.&amp;nbsp; Besides, you get full inellisense based on the MSBuild schema!&amp;nbsp; Wait - there's something better.&amp;nbsp; We will not touch any of the customizations you make to your projects.&amp;nbsp; Customizations will work inside the IDE as well as from the command line&amp;nbsp;- but we will not mess with your changes!&lt;/P&gt;
&lt;P&gt;[Author: Faisal Mohamood]&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=475164" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/msbuild/archive/tags/Faisal+Mohamood/default.aspx">Faisal Mohamood</category><category domain="http://blogs.msdn.com/msbuild/archive/tags/How+To/default.aspx">How To</category></item></channel></rss>