<?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 : AssemblyVersionInfo</title><link>http://blogs.msdn.com/msbuild/archive/tags/AssemblyVersionInfo/default.aspx</link><description>Tags: AssemblyVersionInfo</description><dc:language>en-US</dc:language><generator>CommunityServer 2.1 SP1 (Build: 61025.2)</generator><item><title>Fixing invalid version number problems with the AssemblyInfoTask</title><link>http://blogs.msdn.com/msbuild/archive/2007/01/03/fixing-invalid-version-number-problems-with-the-assemblyinfotask.aspx</link><pubDate>Wed, 03 Jan 2007 21:33:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:1405612</guid><dc:creator>msbuild</dc:creator><slash:comments>20</slash:comments><comments>http://blogs.msdn.com/msbuild/comments/1405612.aspx</comments><wfw:commentRss>http://blogs.msdn.com/msbuild/commentrss.aspx?PostID=1405612</wfw:commentRss><description>&lt;P&gt;The arrival of 2007 bought a flurry of e-mails to the MSBuild team from people having trouble with the AssemblyInfoTask. The symptom is simple to describe -&amp;nbsp;the builds start to fail with the following error:&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="FONT-SIZE: 12pt; FONT-FAMILY: 'Times New Roman','serif'; 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;STRONG&gt;Error emitting 'System.Reflection.AssemblyVersionAttribute' attribute -- 'The version specified '1.0.70102.1' is invalid&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 12pt; FONT-FAMILY: 'Times New Roman','serif'; 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;/P&gt;
&lt;P&gt;&lt;SPAN style="FONT-SIZE: 12pt; FONT-FAMILY: 'Times New Roman','serif'; 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;The fix to get builds going again is to change the date format used to generate&amp;nbsp;the build number to something other than the default "yyMMdd". The date formats are in Microsoft.VersionNumber.target, located in %program files%\MSBuild\Microsoft\AssemblyInfoTask, and there are two of them (one for file version and one for assembly version). You can use any format you want. Within Visual Studio we're now using 01MMdd.&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="FONT-SIZE: 12pt; FONT-FAMILY: 'Times New Roman','serif'; 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;Note that you may have to go in and hand-edit your assemblyinfo.* files to change their version number back to a default starting point of 1.0.0.0 to get your builds going again.&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="FONT-SIZE: 12pt; FONT-FAMILY: 'Times New Roman','serif'; 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;Questions or problems after doing the above? Contact us using the e-mail link at the top of this page.&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="FONT-SIZE: 12pt; FONT-FAMILY: 'Times New Roman','serif'; 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;[ Author: Neil Enns ]&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=1405612" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/msbuild/archive/tags/Neil+Enns/default.aspx">Neil Enns</category><category domain="http://blogs.msdn.com/msbuild/archive/tags/Known+Issues/default.aspx">Known Issues</category><category domain="http://blogs.msdn.com/msbuild/archive/tags/AssemblyVersionInfo/default.aspx">AssemblyVersionInfo</category></item><item><title>How To: Remove the Up-To-Date Check From the AssemblyInfoTask</title><link>http://blogs.msdn.com/msbuild/archive/2006/03/28/how-to-remove-the-up-to-date-check-from-the-assemblyinfotask.aspx</link><pubDate>Tue, 28 Mar 2006 23:57:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:563461</guid><dc:creator>msbuild</dc:creator><slash:comments>11</slash:comments><comments>http://blogs.msdn.com/msbuild/comments/563461.aspx</comments><wfw:commentRss>http://blogs.msdn.com/msbuild/commentrss.aspx?PostID=563461</wfw:commentRss><description>&lt;P&gt;Every couple of weeks I get mail from someone who is using the AssemblyInfoTask on a build machine under source control. The question typically goes like this:&lt;/P&gt;
&lt;P&gt;I added the .targets file to my project, and it works fine on my dev machine, but doesn't do anything when I'm running it in the build lab. What's wrong? Help!&lt;/P&gt;
&lt;P&gt;The reason it "doesn't do anything" is because the default Microsoft.VersionNumber.Targets file includes MSBuild attributes that instruct the build engine to check timestamps on input and output files. These were added because it doesn't make much sense to increment the version number on an assembly if nothing is gettting re-built. This can happen if MSBuild does an incremental build on the project.&lt;/P&gt;
&lt;P&gt;In the build lab, however, all of the input files (.cs files, generally) and the output file (assemblyinfo.cs) wind up with the same timestamps when they are synchronized from the soruce code control server.&lt;/P&gt;
&lt;P&gt;To resolve this, simply remove the Inputs and Outputs attributes from the &amp;lt;Target&amp;gt; tag in the Microsoft.VersionNumber.Targets file. It should wind up looking like this:&lt;/P&gt;&lt;FONT color=#0000ff size=2&gt;
&lt;P&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;UpdateAssemblyInfoFiles&lt;/FONT&gt;&lt;FONT size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&amp;gt;&lt;/P&gt;&lt;/FONT&gt;
&lt;P&gt;[ Author: Neil Enns ]&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=563461" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/msbuild/archive/tags/Neil+Enns/default.aspx">Neil Enns</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/AssemblyVersionInfo/default.aspx">AssemblyVersionInfo</category></item><item><title>How To: Use the AssemblyInfoTask With ASP.NET Web Deployment Projects</title><link>http://blogs.msdn.com/msbuild/archive/2006/01/26/how-to-use-the-assemblyinfotask-with-asp-net-web-deployment-projects.aspx</link><pubDate>Thu, 26 Jan 2006 22:06:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:517531</guid><dc:creator>msbuild</dc:creator><slash:comments>2</slash:comments><comments>http://blogs.msdn.com/msbuild/comments/517531.aspx</comments><wfw:commentRss>http://blogs.msdn.com/msbuild/commentrss.aspx?PostID=517531</wfw:commentRss><description>&lt;P&gt;About once a week we get a question from someone who wants to know how to set the assembly version information on ASP.NET projects. I spoke with Bradley, a development lead over in the ASP.NET team who worked on the &lt;A href="http://msdn.microsoft.com/asp.net/reference/infrastructure/wdp/default.aspx"&gt;Web Deployment Projects&lt;/A&gt;, and it turns there are two ways you can do this.&lt;/P&gt;
&lt;P&gt;If the only thing you're interested in doing is setting the version number on the web deployment project you can do that directly through UI properties on the deployment project instead of editing MSBuild files and downloading another task. For more information look at their &lt;A href="http://download.microsoft.com/download/1/5/4/1541980a-d8fc-407b-8c9f-c2df5445b041/Using%20web_deployment_projects_final.doc"&gt;walkthrough documentation&lt;/A&gt;.&lt;/P&gt;
&lt;P&gt;If you want to set the version number as part of a larger build process that includes desktop assemblies and other class libraries you can use the &lt;A href="http://www.gotdotnet.com/codegallery/codegallery.aspx?id=93d23e13-c653-4815-9e79-16107919f93e"&gt;AssemblyInfoTask&lt;/A&gt; and custom MSBuild XML. To make this work you need to add an assemblyinfo.cs (or .vb) to a folder called &lt;A href="http://dotnetjunkies.com/QuickStartv20/aspnet/doc/pages/code.aspx"&gt;app_code&lt;/A&gt; under your top level directory. Once that file is there you can use the AssemblyInfoTask as you normally would to set the version number, and then use the Web Deployment Project to do the compliation of the assembly for the web.&lt;/P&gt;
&lt;P&gt;[ Author: Neil Enns ]&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=517531" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/msbuild/archive/tags/Neil+Enns/default.aspx">Neil Enns</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/AssemblyVersionInfo/default.aspx">AssemblyVersionInfo</category></item><item><title>How To: Use the AssemblyInfoTask With Source Code Control</title><link>http://blogs.msdn.com/msbuild/archive/2006/01/05/how-to-use-the-assemblyinfotask-with-source-code-control.aspx</link><pubDate>Fri, 06 Jan 2006 01:48:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:508976</guid><dc:creator>msbuild</dc:creator><slash:comments>7</slash:comments><comments>http://blogs.msdn.com/msbuild/comments/508976.aspx</comments><wfw:commentRss>http://blogs.msdn.com/msbuild/commentrss.aspx?PostID=508976</wfw:commentRss><description>&lt;P&gt;Several people have written our feedback alias with problems using the AssemblyInfoTask when the projects are under source code control. When the files are checked in the AssemblyInfo files are read-only, and the task fails with an error that the file can't be updated.&lt;/P&gt;
&lt;P&gt;The best way to handle this is to check the AssemblyInfo files out before running the AssemblyInfoTask. After the build completes you can then either revert the files, or check them back in with the updated version numbers.&lt;/P&gt;
&lt;P&gt;To check the files out and then check them back in using Team Foundation Server add the following lines to your TFSProj file after the &amp;lt;Imports&amp;gt; line for Microsoft.VersionNumber.targets:&lt;/P&gt;
&lt;P&gt;&lt;FONT size=2&gt;&amp;lt;&lt;FONT color=#800000&gt;Target&lt;/FONT&gt;&lt;FONT color=#0000ff&gt; &lt;/FONT&gt;&lt;FONT color=#ff0000&gt;Name&lt;/FONT&gt;&lt;FONT color=#0000ff&gt;=&lt;/FONT&gt;"&lt;FONT color=#0000ff&gt;AfterGet&lt;/FONT&gt;"&lt;FONT color=#0000ff&gt; &lt;/FONT&gt;&lt;FONT color=#ff0000&gt;Condition&lt;/FONT&gt;&lt;FONT color=#0000ff&gt;=&lt;/FONT&gt;"&lt;FONT color=#0000ff&gt;'$(IsDesktopBuild)'!='true'&lt;/FONT&gt;"&lt;/FONT&gt;&lt;FONT size=2&gt;&lt;FONT color=#0000ff&gt;&amp;gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;&lt;/FONT&gt;&lt;FONT color=#800000&gt;Exec&lt;/FONT&gt;&lt;FONT color=#0000ff&gt; &lt;/FONT&gt;&lt;FONT color=#ff0000&gt;WorkingDirectory&lt;/FONT&gt;&lt;FONT color=#0000ff&gt;=&lt;/FONT&gt;"&lt;FONT color=#0000ff&gt;$(SolutionRoot)&lt;/FONT&gt;" &lt;FONT color=#ff0000&gt;Command&lt;/FONT&gt;&lt;FONT color=#0000ff&gt;=&lt;/FONT&gt;"&lt;FONT color=#ff0000&gt;&amp;amp;quot;&lt;/FONT&gt;&lt;FONT color=#0000ff&gt;$(TeamBuildRefPath)\..\tf.exe&lt;/FONT&gt;&lt;FONT color=#ff0000&gt;&amp;amp;quot;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/FONT&gt;&lt;FONT color=#0000ff&gt;checkout /recursive $(AssemblyInfoFiles)&lt;/FONT&gt;"&lt;/FONT&gt;&lt;FONT size=2&gt;&lt;FONT color=#0000ff&gt;/&amp;gt;&lt;BR&gt;&amp;lt;/&lt;/FONT&gt;&lt;FONT color=#800000&gt;Target&lt;/FONT&gt;&lt;FONT color=#0000ff&gt;&amp;gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT size=2&gt;&lt;FONT color=#0000ff&gt;&amp;lt;&lt;/FONT&gt;&lt;FONT color=#800000&gt;Target&lt;/FONT&gt;&lt;FONT color=#0000ff&gt; &lt;/FONT&gt;&lt;FONT color=#ff0000&gt;Name&lt;/FONT&gt;&lt;FONT color=#0000ff&gt;=&lt;/FONT&gt;"&lt;FONT color=#0000ff&gt;AfterCompile&lt;/FONT&gt;"&lt;FONT color=#0000ff&gt; &lt;/FONT&gt;&lt;FONT color=#ff0000&gt;Condition&lt;/FONT&gt;&lt;FONT color=#0000ff&gt;=&lt;/FONT&gt;"&lt;FONT color=#0000ff&gt;'$(IsDesktopBuild)'!='true'&lt;/FONT&gt;"&lt;/FONT&gt;&lt;FONT size=2&gt;&lt;FONT color=#0000ff&gt;&amp;gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;&lt;/FONT&gt;&lt;FONT color=#800000&gt;Exec&lt;/FONT&gt;&lt;FONT color=#0000ff&gt; &lt;/FONT&gt;&lt;FONT color=#ff0000&gt;WorkingDirectory&lt;/FONT&gt;&lt;FONT color=#0000ff&gt;=&lt;/FONT&gt;"&lt;FONT color=#0000ff&gt;$(SolutionRoot)&lt;/FONT&gt;" &lt;FONT color=#ff0000&gt;Command&lt;/FONT&gt;&lt;FONT color=#0000ff&gt;=&lt;/FONT&gt;"&lt;FONT color=#ff0000&gt;&amp;amp;quot;&lt;/FONT&gt;&lt;FONT color=#0000ff&gt;$(TeamBuildRefPath)\..\tf.exe&lt;/FONT&gt;&lt;FONT color=#ff0000&gt;&amp;amp;quot;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/FONT&gt;&lt;FONT color=#0000ff&gt;checkin /comment:&lt;/FONT&gt;&lt;FONT color=#ff0000&gt;&amp;amp;quot;&lt;/FONT&gt;&lt;FONT color=#0000ff&gt;Auto-Build: Version Update&lt;/FONT&gt;&lt;FONT color=#ff0000&gt;&amp;amp;quot;&lt;/FONT&gt;&lt;FONT color=#0000ff&gt; /noprompt /override:&lt;/FONT&gt;&lt;FONT color=#ff0000&gt;&amp;amp;quot;&lt;/FONT&gt;&lt;FONT color=#0000ff&gt;Auto-Build:&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Version Update&lt;/FONT&gt;&lt;FONT color=#ff0000&gt;&amp;amp;quot;&lt;/FONT&gt;&lt;FONT color=#0000ff&gt; /recursive $(AssemblyInfoFiles)&lt;/FONT&gt;"&lt;/FONT&gt;&lt;FONT size=2&gt;&lt;FONT color=#0000ff&gt;/&amp;gt;&lt;BR&gt;&amp;lt;/&lt;/FONT&gt;&lt;FONT color=#800000&gt;Target&lt;/FONT&gt;&lt;FONT color=#0000ff&gt;&amp;gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;Thanks to Gautam from the Team Build team for this tip!&lt;/P&gt;
&lt;P&gt;[ Author: Neil Enns ]&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=508976" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/msbuild/archive/tags/Neil+Enns/default.aspx">Neil Enns</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/AssemblyVersionInfo/default.aspx">AssemblyVersionInfo</category></item><item><title>How To: Retrieve the AssemblyVersion using AssemblyInfoTask</title><link>http://blogs.msdn.com/msbuild/archive/2006/01/04/how-to-retrieve-the-assemblyversion-using-assemblyinfotask.aspx</link><pubDate>Wed, 04 Jan 2006 22:38:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:509308</guid><dc:creator>msbuild</dc:creator><slash:comments>1</slash:comments><comments>http://blogs.msdn.com/msbuild/comments/509308.aspx</comments><wfw:commentRss>http://blogs.msdn.com/msbuild/commentrss.aspx?PostID=509308</wfw:commentRss><description>&lt;P&gt;We got a great question at &lt;A href="mailto:msbuild@microsoft.com"&gt;msbuild@microsoft.com&lt;/A&gt; last week:&lt;/P&gt;
&lt;P&gt;
&lt;BLOCKQUOTE&gt;&lt;FONT color=#0000ff&gt;What is the preferred method to retrieve the version of the assembly that was just built via MSBuild? Post build, we would like to automatically create and copy the assembly(ies) to version folder.&lt;/FONT&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;If you are using the &lt;A href="http://www.gotdotnet.com/codegallery/codegallery.aspx?id=93d23e13-c653-4815-9e79-16107919f93e"&gt;AssemblyInfoTask&lt;/A&gt; and its associated Microsoft.VersionNumber.Targets file this is really easy. Here's what you do:&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'"&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: maroon; FONT-FAMILY: 'Courier New'"&gt;Import&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'"&gt; &lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: red; FONT-FAMILY: 'Courier New'"&gt;Project&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'"&gt;=&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;"&lt;SPAN style="COLOR: blue"&gt;$(MSBuildExtensionsPath)\Microsoft\AssemblyInfoTask\Microsoft.VersionNumber.Targets&lt;/SPAN&gt;"&lt;SPAN style="COLOR: blue"&gt;/&amp;gt;&lt;/SPAN&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;SPAN style="COLOR: blue"&gt;&lt;/SPAN&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;SPAN style="COLOR: blue"&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'"&gt;&lt;FONT color=#0000ff size=2&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 color=#000000 size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;AfterBuild&lt;/FONT&gt;&lt;FONT color=#000000 size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt; &lt;/FONT&gt;&lt;FONT color=#ff0000 size=2&gt;Condition&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;=&lt;/FONT&gt;&lt;FONT color=#000000 size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;$(MaxAssemblyVersion) != ''&lt;/FONT&gt;&lt;FONT color=#000000 size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&amp;gt;&lt;BR&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&amp;nbsp;&amp;nbsp; &amp;lt;&lt;/FONT&gt;&lt;FONT color=#800000 size=2&gt;MakeDir&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt; &lt;/FONT&gt;&lt;FONT color=#ff0000 size=2&gt;Directories&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;=&lt;/FONT&gt;&lt;FONT color=#000000 size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;c:\archive\$(AssemblyName)\$(MaxAssemblyVersion)&lt;/FONT&gt;&lt;FONT color=#000000 size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;/&amp;gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp; &amp;lt;&lt;/FONT&gt;&lt;FONT color=#800000 size=2&gt;CreateItem&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 color=#000000 size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;$(OutputPath)\**\*.*&lt;/FONT&gt;&lt;FONT color=#000000 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;nbsp;&amp;nbsp; &amp;lt;&lt;/FONT&gt;&lt;FONT color=#800000 size=2&gt;Output&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt; &lt;/FONT&gt;&lt;FONT color=#ff0000 size=2&gt;TaskParameter&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;=&lt;/FONT&gt;&lt;FONT color=#000000 size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;Include&lt;/FONT&gt;&lt;FONT color=#000000 size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt; &lt;/FONT&gt;&lt;FONT color=#ff0000 size=2&gt;ItemName&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;=&lt;/FONT&gt;&lt;FONT color=#000000 size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;FilesToArchive&lt;/FONT&gt;&lt;FONT color=#000000 size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;/&amp;gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp; &amp;lt;/&lt;/FONT&gt;&lt;FONT color=#800000 size=2&gt;CreateItem&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&amp;gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp; &amp;lt;&lt;/FONT&gt;&lt;FONT color=#800000 size=2&gt;Copy&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt; &lt;/FONT&gt;&lt;FONT color=#ff0000 size=2&gt;SourceFiles&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;=&lt;/FONT&gt;&lt;FONT color=#000000 size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;@(FilesToArchive)&lt;/FONT&gt;&lt;FONT color=#000000 size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt; &lt;/FONT&gt;&lt;FONT color=#ff0000 size=2&gt;DestinationFolder&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;=&lt;/FONT&gt;&lt;FONT color=#000000 size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;c:\archive\$(AssemblyName)\$(MaxAssemblyVersion)\%(FilesToArchive.RecursiveDir)&lt;/FONT&gt;&lt;FONT color=#000000 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;Target&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&amp;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; COLOR: blue; FONT-FAMILY: 'Courier New'"&gt;&lt;FONT color=#0000ff size=2&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&amp;nbsp;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;Now that I look at this, perhaps "really easy" isn't the right way to describe it :) In fact, I had to have Faisal show me how to do the &lt;a href="http://blogs.msdn.com/msbuild/archive/2005/11/07/490068.aspx"&gt;recursive copy&lt;/A&gt;, and Kieran help me figure out that a &lt;a href="http://blogs.msdn.com/msbuild/archive/2005/10/04/476725.aspx"&gt;CreateItem&lt;/A&gt; was needed.&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;The $(MaxAssemblyVersion) property holds the version number for the build. This is used with the &lt;A href="http://msdn2.microsoft.com/en-us/library/s2448zz7.aspx"&gt;MakeDir&lt;/A&gt; task to create the directory. The &lt;A href="http://msdn2.microsoft.com/en-us/library/s2y3e43x.aspx"&gt;CreateItem&lt;/A&gt; task is used to collect all the files from the output directory into an item group so it can then be copied recursively using the &lt;A href="http://msdn2.microsoft.com/en-us/library/3e54c37h.aspx"&gt;Copy&lt;/A&gt; task. Note the use of the &lt;A href="http://msdn2.microsoft.com/en-us/library/ms164313(en-US,VS.80).aspx"&gt;RecursiveDir metadata&lt;/A&gt;, as described in Faisal's post on recursive copy to ensure all the files are copied as a full directory tree into the archive directory.&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;The condition on AfterBuild prevents the directory from being created if the MaxAssemblyVersion wasn't set during the build. This happens when none of the files changed, and nothing was re-built. Instead of depending on the $(MaxAssemblyVersion) property you could also set up the Inputs and Outputs to the target to be very specific about what file updates will trigger a copy to the archive directory.&lt;/P&gt;
&lt;P&gt;If you're interesed in where $(MaxAssemblyVersion) comes from, it is set by the Microsoft.VersionNumber.Targets file when the AssemblyInfoTask is run. The snippet from the .targets file looks like this:&lt;/P&gt;&lt;FONT color=#0000ff&gt;&lt;FONT face="Courier New" size=2&gt;&lt;FONT color=#0000ff size=2&gt;
&lt;P&gt;&amp;lt;&lt;/FONT&gt;&lt;FONT color=#800000 size=2&gt;AssemblyInfo&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt; [... junk removed for clarity ... ]&amp;gt;&lt;BR&gt;&lt;/FONT&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face="Courier New"&gt;&lt;FONT size=2&gt;&lt;FONT color=#800000&gt;Output&lt;/FONT&gt;&lt;FONT color=#0000ff&gt; &lt;/FONT&gt;&lt;FONT color=#ff0000&gt;TaskParameter&lt;/FONT&gt;&lt;FONT color=#0000ff&gt;=&lt;/FONT&gt;"&lt;FONT color=#0000ff&gt;MaxAssemblyVersion&lt;/FONT&gt;"&lt;FONT color=#0000ff&gt; &lt;/FONT&gt;&lt;FONT color=#ff0000&gt;PropertyName&lt;/FONT&gt;&lt;FONT color=#0000ff&gt;=&lt;/FONT&gt;"&lt;FONT color=#0000ff&gt;MaxAssemblyVersion&lt;/FONT&gt;"&lt;FONT color=#0000ff&gt;/&amp;gt;&lt;BR&gt;&lt;FONT color=#0000ff size=2&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;&lt;/FONT&gt;&lt;FONT color=#800000 size=2&gt;Output&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt; &lt;/FONT&gt;&lt;FONT color=#ff0000 size=2&gt;TaskParameter&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;=&lt;/FONT&gt;&lt;FONT color=#000000 size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;MaxAssemblyFileVersion&lt;/FONT&gt;&lt;FONT color=#000000 size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt; &lt;/FONT&gt;&lt;FONT color=#ff0000 size=2&gt;PropertyName&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;=&lt;/FONT&gt;&lt;FONT color=#000000 size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;MaxAssemblyFileVersion&lt;/FONT&gt;&lt;FONT color=#000000 size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;/&amp;gt;&lt;BR&gt;&lt;/FONT&gt;&amp;lt;/&lt;FONT color=#800000&gt;AssemblyInfo&amp;gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;This causes the value of the "MaxAssemblyVersion" property on the AssemblyInfo class (the one in .NET code) to get stuck in the MSBuild "MaxAssemblyVersion" property after the task is run. The same thing happens for MaxAssemblyFileVersion.&lt;/P&gt;
&lt;P&gt;[ Author: Neil Enns ]&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=509308" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/msbuild/archive/tags/Neil+Enns/default.aspx">Neil Enns</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/AssemblyVersionInfo/default.aspx">AssemblyVersionInfo</category></item><item><title>AssemblyInfoTask Version 1.0.51130.0 is now available!</title><link>http://blogs.msdn.com/msbuild/archive/2005/12/07/assemblyinfotask-version-1-0-51130-0-is-now-available.aspx</link><pubDate>Wed, 07 Dec 2005 22:41:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:501180</guid><dc:creator>msbuild</dc:creator><slash:comments>1</slash:comments><comments>http://blogs.msdn.com/msbuild/comments/501180.aspx</comments><wfw:commentRss>http://blogs.msdn.com/msbuild/commentrss.aspx?PostID=501180</wfw:commentRss><description>&lt;P&gt;I just posted an updated version of the AssemblyInfoTask and its source code to our &lt;A class="" href="http://www.gotdotnet.com/Community/UserSamples/Details.aspx?SampleGuid=5C455590-332C-433B-A648-E368B9515580" mce_href="http://www.gotdotnet.com/Community/UserSamples/Details.aspx?SampleGuid=5C455590-332C-433B-A648-E368B9515580"&gt;GotDotNet user sample page&lt;/A&gt;. This new release fixes support for Visual J# projects, includes an updated installer that installs the task into the Global Assembly Cache, support for installing as a non-administrator, a few bug fixes to the help documentation, and full code-signing and strong name for the compiled assembly.&lt;/P&gt;
&lt;P&gt;Enjoy!&lt;/P&gt;
&lt;P&gt;[ Author: Neil Enns ]&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=501180" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/msbuild/archive/tags/Neil+Enns/default.aspx">Neil Enns</category><category domain="http://blogs.msdn.com/msbuild/archive/tags/Tools/default.aspx">Tools</category><category domain="http://blogs.msdn.com/msbuild/archive/tags/AssemblyVersionInfo/default.aspx">AssemblyVersionInfo</category></item><item><title>How To: Update Assembly Version Numbers with MSBuild</title><link>http://blogs.msdn.com/msbuild/archive/2005/11/11/how-to-update-assembly-version-numbers-with-msbuild.aspx</link><pubDate>Sat, 12 Nov 2005 01:38:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:491947</guid><dc:creator>msbuild</dc:creator><slash:comments>60</slash:comments><comments>http://blogs.msdn.com/msbuild/comments/491947.aspx</comments><wfw:commentRss>http://blogs.msdn.com/msbuild/commentrss.aspx?PostID=491947</wfw:commentRss><description>&lt;P&gt;&lt;STRONG&gt;UPDATE: For information on the "Y7K" or "2007" issue, see&amp;nbsp;&lt;/STRONG&gt;&lt;A class="" href="http://blogs.msdn.com/msbuild/archive/2007/01/03/fixing-invalid-version-number-problems-with-the-assemblyinfotask.aspx" mce_href="http://blogs.msdn.com/msbuild/archive/2007/01/03/fixing-invalid-version-number-problems-with-the-assemblyinfotask.aspx"&gt;&lt;STRONG&gt;our new blog entry&lt;/STRONG&gt;&lt;/A&gt;&lt;STRONG&gt;.&amp;nbsp;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;One of our most frequently asked questions is: "How do update my assembly version numbers at build time?". Unfortunately our answer has been "you can't". Until today, that is.&lt;/P&gt;
&lt;P&gt;I just posted a new task, &lt;A class="" href="http://www.gotdotnet.com/Community/UserSamples/Details.aspx?SampleGuid=5C455590-332C-433B-A648-E368B9515580" mce_href="http://www.gotdotnet.com/Community/UserSamples/Details.aspx?SampleGuid=5C455590-332C-433B-A648-E368B9515580"&gt;AssemblyInfoTask&lt;/A&gt;, at GotDotNet. It provides complete support for a wide variety of version number styles, from a fixed number to numbers that change daily to numbers that increment on every build. It also supports setting other properties such as AssemblyTitle, AssemblyCopyright, etc.&lt;/P&gt;
&lt;P&gt;Even better, we've posted the complete source code, unit tests (that run in Visual Studio Team System), and raw documentation for the task under the new &lt;A href="http://www.microsoft.com/resources/sharedsource/licensingbasics/communitylicense.mspx" mce_href="http://www.microsoft.com/resources/sharedsource/licensingbasics/communitylicense.mspx"&gt;Microsoft Community License&lt;/A&gt;. Try not to laugh too hard when you look at the code. Remember, I don't write code for a living, I'm one of those touchy-feely Program Manager people :)&lt;/P&gt;
&lt;P&gt;If all you want to do is get Visual Studio-style build numbers, of the form 1.0.yyMMdd.revision (for example, 1.0.51111.02 for the third build today), then you simply add the following line to your project file after any existing &amp;lt;Imports&amp;gt;:&lt;/P&gt;&lt;FONT color=#0000ff&gt;
&lt;P&gt;&lt;FONT face="Courier New" size=2&gt;&amp;lt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face="Courier New"&gt;&lt;FONT size=2&gt;&lt;FONT color=#800000&gt;Import&lt;/FONT&gt;&lt;FONT color=#0000ff&gt; &lt;/FONT&gt;&lt;FONT color=#ff0000&gt;Project&lt;/FONT&gt;&lt;FONT color=#0000ff&gt;=&lt;/FONT&gt;"&lt;FONT color=#0000ff&gt;$(MSBuildExtensionsPath)\Microsoft\AssemblyInfoTask\Microsoft.VersionNumber.targets&lt;/FONT&gt;"&lt;FONT color=#0000ff&gt;/&amp;gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;If anyone has trouble getting it to work, has comments, questions, or suggestions, please send 'em our way to &lt;A href="mailto:msbuild@microsoft.com" mce_href="mailto:msbuild@microsoft.com"&gt;msbuild@microsoft.com&lt;/A&gt; or &lt;A href="http://forums.microsoft.com/msdn/showforum.aspx?forumid=27&amp;amp;siteid=1" mce_href="http://forums.microsoft.com/msdn/showforum.aspx?forumid=27&amp;amp;siteid=1"&gt;post to our forum&lt;/A&gt;.Enjoy!&lt;/P&gt;
&lt;P&gt;[ Author: Neil Enns ]&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=491947" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/msbuild/archive/tags/Neil+Enns/default.aspx">Neil Enns</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/Tools/default.aspx">Tools</category><category domain="http://blogs.msdn.com/msbuild/archive/tags/AssemblyVersionInfo/default.aspx">AssemblyVersionInfo</category></item></channel></rss>