PDA

View Full Version : Increment Version Doesn't Work for Link Files


dprice
02-03-2005, 03:53 PM
We use a shared AssemblyInfo file in our solution for setting common assembly attributes like Assembly Version, Copyright info, etc. When using the option to have VBP increment the assembly version, it adds an assembly version attribute to all of the project AssemblyInfo.cs files in addition to the shared AssemblyInfo file. This causes a compile error since there are duplicate AssemblyVersion attributes set.

See the source code from the Microsoft Enterprise Library to see an example of this:
http://msdn.microsoft.com/library/en-us/dnpag2/html/entlib.asp

We ended up using a few extra steps to automate this process, but it would be nice to just use the VS.NET increment option.

Thanks,
Derek

kinook
02-04-2005, 08:43 AM
You can still use the Make VS.NET increment capability, just create a separate step to increment the version, specifying the shared AssemblyInfo.cs filename on the Project/Solution tab, then don't increment the version in the step that builds the solution. See the help for more details: http://www.visualbuild.com/Manual/?makevs_net.htm

dprice
02-07-2005, 03:19 PM
I tried what you suggested and it works - sort of. I created a Make VS.NET step. On the Projects/Solutions tab, I specified my shared assembly file, I checked "Don't build the projects..." and selected "All" for which config to build. When I test it, the assembly version is updated, but I get a build error:

--------------------Starting Build: 'MyBuild.bld'--------------------
Building project step 'Increment Shared Assembly Version Only'...
incrementing version...Object reference not set to an instance of an object.
Step 'Increment Shared Assembly Version Only' failed
Build ended.

If I check "Ignore step failure", then it updates the assembly version with no error, but I have no idea if anything else went wrong. What am I missing?

Thanks!
Derek

kinook
02-07-2005, 04:05 PM
http://www.kinook.com/Forum/showthread.php?threadid=849

dprice
02-07-2005, 04:14 PM
Got it - thanks!
Derek