Nighttrain5150
Nighttrain5150

Reputation: 53

MSBuild not recognizing assembly version in SharedAssemblyInfo

I have a solution with multiple projects and created a SharedAssemblyInfo (as links) so that I can share the version number across all the projects. I also have an AssemblyInfo file in each project for the assemblyName and guid. When I build and run locally it runs fine. When I attempt to build, MSBuild throws an exception when it tried to retrieve the version number. I'm getting a null reference exception when I tried to retrieve the assembly version. Any ideas?

Upvotes: 0

Views: 253

Answers (1)

Nighttrain5150
Nighttrain5150

Reputation: 53

So I figured out the error. In tfs, where I create a new build definition, you can specify a build template. We are using our own custom build template, which I don't have access to see what its doing but I'm able to use it. In the process section there was a line called "Increment version number". This was by default selected as true. When I set this to false I can get it to build now. I assume our custom build template must be specifying this action to use the assemblyinfo.cs file. So I could modify our build template to look for version number in sharedassemblyinfo.cs or in my case I just marked it not to increment version number.

Upvotes: 1

Related Questions