Gitversion: Update AssemblyInfo files failes for *.vb files

Created on 11 May 2016  路  22Comments  路  Source: GitTools/GitVersion

When using the GitVersion Task for VSTS the following error occurs on VB projects:

image

This is due to the c# assembly info being added..

Workaround: Disable the GitVersion task and build succeeds

Most helpful comment

@MrHinsh We've agreed on an outline for a new build process which will hopefully automate everything. 馃槂

All 22 comments

@MrHinsh can you confirm what version of GitVersion you are using within that Build Step? Thanks!

FWIW, I am building our VB.net project on TFS, but using the msbuild task to update assembly info - not the marketplace extension.

Also, I am using 3.5.2

@MrHinsh, @apmorton Can you please try out the just released version 3.5.4 and see if that helps in any way?

@pascalberger Is this something you can help out with? I know absolutely zilch about VSTS. 馃槃

You should get that as part of your automated DevOps pipeline ;)

@MrHinsh We've agreed on an outline for a new build process which will hopefully automate everything. 馃槂

Unfortunately VSTS throws an error that I don't have permissions to upload. Therefore it seems like we have to wait until tomorrow that @JakeGinnivan can have a look.

Have pushed the update.

@MrHinsh unfortunately the way appveyor does it's deployments means we can't have a pipeline to vsts. We need to either switch our build system or we need to rejig how we are doing builds/releases. I'm going to sit down with @gep13 at NDC Oslo and sort it out.

I am also speaking at NDC Oslo, maybe we can catch up! I'll also just leave this here: https://nkdagility.com/open-source-vsts-tfs-github-better-devops/

Yeah that would be good, didn't get a chance last MVP Summit.

Not a bad idea using vsts as your build for github. Two quick q's.

Is there an easy way to get VSTS to publish build results back to github PRs? And is it possible to make the builds public? (if it publishes results the link will require auth, not a huge issue just wondering)

All I know is I need a better way to release my OSS stuff, AppVeyor said there was improvements coming to deployment about 12 months ago and I was waiting but doubt it will happen.

I publish the build results as a release back to GitHub. Then I use Release Management to pull the output of the build and deploy it to Nuget / VSTS...

I use 4 builds... Two to do the sync 馃榾, then I have one in VSTS that protects MASTER on GitHub, and another that protects MASTER on VSTS. That way I can have a pull request on either side.

I use VSTS as the master repo, but if you use GitHub as the master then all you need is to Build in VSTS from GitHub and publish out, or use RM to do that...

@asbjornu I have 3.5.4 and am currently experiencing this issue.

@c0bra, @MrHinsh, @apmorton: Do you have any idea how this problem can be reproduced? Do you have a minimal .vbproj you can contribute that exposes the problem? I can't find anything obvious in AssemblyVersionInfoTemplates that should make it choose the wrong template. If the input file is *.vb, it should pick the embedded VersionAssemblyInfo.vb file.

@asbjornu VSTS task uses the GitVersionExe, which from a quick read over, does not use the code you linked to unless you specify a path on the command line, and that file doesn't exist.

See AssemblyInfoFileUpdate.cs

IE
/updateassemblyinfo true will not use any templates ever - it only scans for existing AssemblyInfo.(cs|vb)
/updateassemblyinfo MyInfo.vb will not use any templates if MyInfo.vb already exists

This has some ramifications later, when ReplaceOrAppend is called.

If the regex is matched for each call to ReplaceOrAppend, things work fine - because it uses the regex.Replace method to only modify the bits inside the [assembly] bit
If the regex is _not_ matched for any call, things blow up.

this is the problem -> const string assemblyAddFormat = "[assembly: {0}]";

@MrHinsh as a temporary workaround, if you add the following line to your AssemblyInfo.vb, it should work

VB.NET <Assembly: AssemblyInformationalVersion("1.0.0.0")>

Perfect Timing, I was about to test my theory on our visualstudio.com project, and its down.

https://www.visualstudio.com/en-us/support/support-overview-vs

wow

I think I've managed to create a test that reproduces the problem. Thanks for the information, @apmorton, @MrHinsh! I'll create a PR for this ASAP.

I've created #882 which should fix this.

I ran into this issue on VSTS. Will there be a 3.5.5 Version?

:+1: it would be nice to get this fix into a release.

Was this page helpful?
0 / 5 - 0 ratings