Fixing invalid version number problems with the AssemblyInfoTask

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 – the builds start to fail with the following error: Error emitting ‘System.Reflection.AssemblyVersionAttribute’ attribute — ‘The version specified ‘1.0.70102.1’ is invalid The fix to get builds going again is to…


How To: Remove the Up-To-Date Check From the AssemblyInfoTask

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: 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….


How To: Use the AssemblyInfoTask With ASP.NET Web Deployment Projects

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 Web Deployment Projects, and it turns there are two ways you can do this. If…


How To: Use the AssemblyInfoTask With Source Code Control

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. The best way to handle this is to check the AssemblyInfo…


How To: Retrieve the AssemblyVersion using AssemblyInfoTask

We got a great question at last week: 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. If you are using the AssemblyInfoTask and its associated Microsoft.VersionNumber.Targets file this is…


AssemblyInfoTask Version 1.0.51130.0 is now available!

I just posted an updated version of the AssemblyInfoTask and its source code to our GotDotNet user sample page. 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,…


How To: Update Assembly Version Numbers with MSBuild

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