2

If you're using ClickOnce to manage your deployments and updates it may be configured to actively query a URL/manifest for the latest version of your project and then comparing its current version to this to determine if an update needs to be done. Does anyone know what the numerical limits are of the comparison routine? Because I have an automated process doing the builds, we're dropping a timestamp into the four-component of the version (e.g. 1.0.0.x; it's just digits without any symbols). However, I'm concerned that there being an eight-digit number in this spot might potentially crash the comparison. Microsoft no no do so good with unexpected requirements.

Does anyone have experience with this?

Thanks.

1
  • Under the covers it appears to be using System.Version to parse and compare the values, so it seems like your application is limited to int.MaxValue. Commented Aug 11, 2016 at 21:29

1 Answer 1

4

Let's walk the trail. If you start plugging in larger numbers, eventually setup.exe will poll for the latest version and then fail with "Cannot continue. The application is improperly formatted. Contact the application vendor for assistance."

ClickOnce version fail

If you look at the details, you'll see a log which may say the following:

+ The 'version' attribute is invalid - The value '1.0.0.161739' is invalid according to its datatype 'urn:schemas-microsoft-com:asm.v1:fourPartVersionType' - The Pattern constraint failed.
+ The Pattern constraint failed.

If you Google for "fourPartVersionType", you'll find yourself at FourPartVersionType Simple Type, which provides the following regular expression:

([0-9]{1,4}|[0-5][0-9]{4}|6[0-4][0-9]{3}|65[0-4][0-9]{2}|655[0-2][0-9]|6553[0-5])(\.([0-9]{1,4}|[0-5][0-9]{4}|6[0-4][0-9]{3}|65[0-4][0-9]{2}|655[0-2][0-9]|6553[0-5])){3}

This basically limits each component to four- or five-digits and, essentially, no greater than 65536 in the latter.

Sign up to request clarification or add additional context in comments.

2 Comments

Shouldnt that be enough? Honestly what speaks against increasing the Revision/Minor from time to time? 65536 builds are more than enough
Sure, if you aren't incrementing for every commit. Even then, you require a method of persistence such that you can maintain an increasing number. If you can't accommodate that (like in this situation, implied by the question) you may wish to use a timestamp (the next natural thing).

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.