Search Unity

  1. Unity 2019.2 is now released.
    Dismiss Notice

[Solved] Package Manager 2.1.1 not working with most CultureInfo

Discussion in 'Package Manager' started by Djayp, Feb 9, 2019.

  1. Djayp

    Djayp

    Joined:
    Feb 16, 2015
    Posts:
    73
    The Package Manager throws exceptions in PackageInfo.cs, l.76 :
    var version = Convert.ToDouble(shortVersionId.Split('@')[1]);    // Works since shortversion acts like a decimal
    (I love this comment :) )

    replaced by :
    var version = Convert.ToDouble(shortVersionId.Split('@')[1], System.Globalization.CultureInfo.CreateSpecificCulture("en-US"));
     
    jashan and alexzzzz like this.
  2. alexzzzz

    alexzzzz

    Joined:
    Nov 20, 2010
    Posts:
    1,408
    With Russian too. Actually with half of the world's CultureInfo.

    Noobs!

    System.Globalization.CultureInfo.InvariantCulture

    decimal.png

    PS
    Also, not sure it's a good place for using floating point values.
    Code (CSharp):
    1. if (version < 4.1))
    2.     redirectUrl = "https://github.com/Unity-Technologies/ShaderGraph/wiki";
    There's no such thing as 4.1. There is
    Code (CSharp):
    1. if (version < 4.0999999999999996447286321199499070644378662109375))
    2.     redirectUrl = "https://github.com/Unity-Technologies/ShaderGraph/wiki";
    Maybe it's fine, but still super weird.
     
    Last edited: Feb 9, 2019
    DeoSsin and jashan like this.
  3. maximeb_unity

    maximeb_unity

    Unity Technologies

    Joined:
    Mar 20, 2018
    Posts:
    144
    Thank you for reporting the issue. It will be fixed in a future release of the package.
     
    MNNoxMortem and Djayp like this.