Trouble passing build number with TFS


I can’t seem to get this to work. I’ve added the following to my MSBuild arguments.


I’ve seen this in a few examples but it doesn’t work for me. I’m getting the error “’$(TF_BUILD_BUILDNUMBER)’ is not a valid version string.”

Any ideas?



Thanks for getting in touch. It looks like you found the answer to your problem on StackOverflow, is that right?

Please get back in touch if that’s not the case!

Hi Mike,

Yes, I did fix it eventually. I would still be interested in knowing why
the environment variables work in one of the build process templates and
not the other?


Hi Shane,

Thanks for getting back to me. I’ve personally used TFS on several projects but I’d have to admit I’ve tried to steer clear of build process template customisation, so I’m not sure I can help you understand the root cause any better. It does seem like it was a purely TFS problem though - but if I’m mistaken and Octopus could have been a contributing factor to the root cause please get back in touch!

Happy Deployments!