Hi there, I’ve found a bug in the VB6 task. If the
CurrentCulture is different from us-en. (eg. Norwegian) the double.Parse
statements used in parsing the majorver, minorver and lcid values in the
project file crash. double.Parse is culture dependant. Could someone with access be so kind to update the VB6Task.cs
file with the following fix: System.Globalization.NumberFormatInfo
nfi = new System.Globalization.CultureInfo( "en-US", false
).NumberFormat; //Fix // # Added to properly
cast the parts of the version # // Ensure that we use
the correct cast option string temp =
match.Groups["majorver"].Value; ushort majorVer = (-1
< temp.IndexOf(".")) ? (ushort)double.Parse(temp, nfi) :
ushort.Parse(temp); //Fix temp =
match.Groups["minorver"].Value; ushort minorVer = (-1
< temp.IndexOf(".")) ? (ushort)double.Parse(temp, nfi) :
ushort.Parse(temp); //Fix temp =
match.Groups["lcid"].Value; uint lcid = 0; if (0 < temp.Length)
{ lcid = (-1 <
temp.IndexOf(".")) ? (uint)double.Parse(temp, nfi) :
uint.Parse(temp); //Fix } The only change I have made is to introduce the
NumberFormatInfo variabel and passed it to the 3 Parse statements. It works fine with this fix. Regards, Jan
Lønsetteig |
- Re: [NAntC-Dev] VB6 Task bug - and fix Jan Lønsetteig
- Re: [NAntC-Dev] VB6 Task bug - and fix Ian MacLean