views:

328

answers:

5

In all of my other .net apps my build process (a mixture of nant and custom tasks) automatically updates the [AssemblyVersionAttribute] AssemblyInfo.cs with the current build number before the call to msbuild, stamping in the build number in the version number.

I'm now working on my first BizTalk project and I'd like to do the same thing with the version numbers of the BizTalk assemblies, but I've run into trouble!

First of all the aseembly version numbers are stored in the btproj files, so I did some googling and found www.codeplex.com/biztalk which looked like the answer to my problem, but there is a deeper problem!

I have a project for my schemas and another for my pipelines, the pipelines project references my schemas project as I have a flat file dis/assemblers. The problem comes when I update the version numbers, as updating them even from within visual studio does not update the pipeline components references to the schemas.

So if I update all the version numbers manually in the VS IDE from 1.0.0.0 to 1.1.0.0, the build fails as the pipeline components flat file dis/assemblers still reference the old 1.0.0.0 version of the schemas! They don't automatically update!

Is this really a manual process of updating the version numbers of the BizTalk projects in the property pages, then building the projects and manually updating the references to them in the properties of all the pipeline components that reference them?

This means that I can't have my build process control the build number part of my version numbers!

Or is there a better method of managing the version numbers of the BizTalk assemblies?

+2  A: 

I'm sorry to disappoint you but I've been down the exact some road I had to give up. I guess it could be possible to achieve it but it would require a lot of changes to both the biding files and other XML files (as you mentioned and even more if you have published services etc).

Maybe it could be possible to wrap all these necessary changes in a build step (a MSBuild step or similar in other build frameworks) - that would be useful!

Riri
A: 

Gutted, thought that might be the case. Maybe BizTalk 2009 projects will play more nicely when updating references when changing version numbers.

I started to go through and automate it manually, and when I realised what needed to be done, I took a biiig step back when I realised just how many places I'd have to modify to get it working. Thank god for Undo Checkout.

I do have a standard C# class library included in my project (various helper functions), which i am able to update the version number of during my build process, so I'm basically using that one assembly to version the whole application. If anyone wants to know what version is in any environment, check out the version number of that one assembly.

Not ideal, but it's working.

Chris Browne
I've heard on the wire that proper integration with MSBuild is one of the big new feature for BT 2009
David Hall
cant wait for that then!it would be great to get these biztalk solutions in line with the rest of our builds.
Chris Browne
A: 

We've done this successfully on our project - I'll see if I can get the developer of the tool to post details...

Ben
+2  A: 

Developer- :)

We had the similar problem and we ended up developing a small utility which would change the version number in all the projects i.e. *.csproj (asssemblyinfo.cs), *.btproj accordingly. Apart from this it would open and modify the *.btp files with the new version of schemas. In nutshell, what all you have to do is to configure this utility in your VS.net tools menu and execute it.

I guess its not very difficult to develop such utility in any .net lanagauge.

Caveat: Do not forget to save the files after updates with the same encoding as they were originally.

Cheers!

A: 

Hi Chris,

This problem arises when you perform an integration build to the latest versions of your dependent components as file references (aka schemas here).

Keep in mind that upgrading the assemblyversion must always performed manually, that way you are always in charge of changes to assemblyversions.

A possible solution to solve the buildbreaks issue is to file reference to a specific version of a dependent component build and not to the latest version and use a subst drive and a copy script to get the latest component builds.

For example:

SchemaA, assembly version 1.0.0.0 PipelineA (with pipelinecomponent XMLValidator for example), assembly version 1.0.0.0

PipelineA has a file reference to a subst drive(say R drive, which maps to a workspace D:\MyComponents) and version 1.0.0.0 of SchemaA as follows:

R:\SchemaA\1.0.0.0\SchemaA.dll.

The copy-script copies the buildoutput of SchemaA locally to your R drive.

When schema A updates to version 1.1.0.0 you don't have any issues because you still use version 1.0.0.0 and YOU have the choice to use the 1.1.0.0 version of your schema. When you want to upgrade, you have to alter your copy-script and replace the file reference to R:\SchemaA\1.1.0.0\SchemaA.dll.

Patrick Peters