Jenkins and Microsoft projects

We have a .Net solutions which contains an Outlook Addin project and an installer project (vdproj). We have jenkins running as continuous integration/build tool.

The first challenge I had is to set assembly version from jenkins instead of setting from project. This is done by “echo” jenkins version info into project/properties/AssemblyInfo.cs file.

The second challenge I had is to build vdproj installer project. I was using MSBuild to build outlook addin project but unfortunately MSBuild cannot build vdproj file. After googling I have to use devenv.com command line to build the solution.

The third challenge is to set ApplicationVersion. The ApplicationVersion is used in manifest file and if that remains same, ClickOnce installer will complaint same manifest has already been installed. I only realised this problem recently. The first solution is to pass ApplicationVersion in MSBuild. But MSBuild cannot be used for vdproj. So I run MSBuild first then devenv. Unfortunately everytime devenv will rebuild my outlook addin project and thus reset ApplicationVersion. After a few trying I found the link: http://stackoverflow.com/questions/4192407/passing-msbuild-options-when-calling-devenv

All you need to do is just passing ApplicationVersion through environment variable before calling devenv.com. So below works:

 

Leave a Reply

Your email address will not be published. Required fields are marked *