Ian
Jan Lønsetteig wrote:
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 *_Senior System Developer_* [EMAIL PROTECTED]
--
Ian MacLean, Developer, ActiveState, a division of Sophos
http://www.ActiveState.com
------------------------------------------------------- This SF.net email is sponsored by: SF.net Giveback Program. Does SourceForge.net help you be more productive? Does it help you create better code? SHARE THE LOVE, and help us help YOU! Click Here: http://sourceforge.net/donate/ _______________________________________________ NAntContrib-Developer mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/nantcontrib-developer