Do Add-In need realy work in this way?

May 19, 2010 at 10:28 AM

When I work in debug mode and run Start Debuging (F5) my programm version is incrementing, why? Can i set increment only when i switch Release mode?

My solution contains 9 project and each time when I build solution programm version increments at +9.

For exapmle now my version is 2.0.10.10139 when I build version go to 2.0.19.10139, build again version go to 2.0.28.10139!

May 19, 2010 at 12:28 PM

You need to change the Condition section (Configuration Name).  It is probably set to "Any".  Change it to "Release" and it will only increment when your solution is "Release".

You can also change the the "Build Action" to Build or ReBuild so that you only increment on a Build and not on a ReBuild (or visa versa).

May 19, 2010 at 12:40 PM
Edited May 19, 2010 at 12:41 PM

and how solve, problem with my 9 project, each time when i run Build, programm version is incremented 9 times, because each project are Build and if I undersant right on each Build version is incremented + 1 and there is 9 Builds

May 19, 2010 at 12:58 PM

How are you building these projects?  I build my solution which increments each project individually and only once.  

If you build the same project 9 times then by design it would increment 9 times.

May 19, 2010 at 1:20 PM

In my solution explorer is SetupProject when I need make installation for program I select this project right mouse click and Build, this build each project. Some times I select solution and make Build.

Maybe I know where is the problem I have only one AssemblyInfo.cs file and reference it for all 9 project.

And when Builds first project Add-In change version first time, when Builds second time Add-In change version second time and so nine times.

 

May 19, 2010 at 1:25 PM

Ahhh... that makes sense now, the add-in doesn't know that you are using a shared AssemblyInfo.cs file and it increments it for each project.  Not sure where you would to set that.  Maybe the developers will have an idea.

May 19, 2010 at 1:30 PM

Maybe I need report it like bug?

 

May 19, 2010 at 1:38 PM

Maybe not a bug, but a feature request... maybe there is something in place already (that I'm not aware of) or they can add a setting to only increment once per build.

Coordinator
May 19, 2010 at 2:54 PM
If you want to increment a version in a assemblyinfo file that is shared by multiple projects, you'll have to specify it at solution level. So instead of setting the same assembly for every project you just set it once at the root (solution) node.
May 19, 2010 at 3:49 PM
I don't understand what exactly I need to do! Can you explain one more time?
Coordinator
May 19, 2010 at 4:28 PM
I've created an example solution that has one shared assembly info file that is incremented at release build. http://autobuildversion.codeplex.com/releases/view/45575
May 19, 2010 at 8:26 PM
Edited May 19, 2010 at 8:27 PM
Before I try that is v2.1 without any luck. After a few attempts, I decide install v2.2 Beta. And in beta this thing works like a charm (I create my own Solution with two project with shared AssemblyInfo.cs file). In your screenshot you are using v2.2 beta. One more question, can I turn off auto versioning for some solutions and for some solutions turn on automatic versioning? Because not always I need this feature. btw ... thanks for the help :)
Coordinator
May 20, 2010 at 6:02 AM
Edited May 20, 2010 at 6:05 AM
The addin only increments when: 1. When the Version Increment checkbox is checked (found in the settings dialog). 2. Increment settings are found at solution or project level. 3. Either the AssembyVersion or AssemblyFileVersion attribute is selected for increment in these settings. So by default the addin does not do a thing unless you tell it to. (Edit: Sorry, it seems that CodePlex doesn't like my Mac and removes my returns in my post, making it a bit unreadable ... I'll fix that later)