I have a simple C# application which has a main form (lets call it Form1) with some sub forms which are opened by button clicks etc.
My application generally works, but seems users in some countries of the world have issues/crashes.
Nearly all of the come out with this error:
system.formatexception
I thought it was something to do with my formats etc so as a intirim fix if users changed there's language/location/formats to English(United Kingdom) it worked, I have had reported that users don't even need to change this, all they had to do was change the Non-Unicode setting in the control panel to English(United Kingdom)
As a fix I amended all my datetime formatting (As this is pretty much the only formatting I think I do) with Culture Invariant.
This has limited success, so at the top of "Form1" before the InitializeComponent() I placed:
System.Globalization.CultureInfo cultureInfo = new System.Globalization.CultureInfo("en-GB");
Application.CurrentCulture = cultureInfo;
System.Threading.Thread.CurrentThread.CurrentCulture = CultureInfo.GetCultureInfo("en-GB");
This actually seemed to work for almost all, my USA users were happy and had no issues.
The problem I am still having is specifically from South Korea, whether other countries are facing the same issue I don't know, but I definatly know SK are still getting the System.FormatExecption error.
So, question is, how do i force the whole (Small) program to use en-GB for all settings, and/or have I done my threading properly to make sure the thread uses the correct culture information.
This actually seemed to work for almost all, my USA users were happy and had no issues.
The problem I am still having is specifically from South Korea, whether other countries are facing the same issue I don't know, but I definatly know SK are still getting the System.FormatExecption error.
So, question is, how do i force the whole (Small) program to use en-GB for all settings, and/or have I done my threading properly to make sure the thread uses the correct culture information.
VulpesPosted May 23, 2013, 8:41 AM
VulpesPosted May 23, 2013, 9:10 AM
Yeah, it's probably all you can do in the circumstances.
BTW, any particular reason why you've struck with .NET 4.0 even though you could have used 4.5?
Jay SPosted May 23, 2013, 8:48 AM
I guess I could change my PC's settings to fool it to think it's in South Korea and try to replicate.
My application has no threading at all, no background workers.
The fact i put in:
System.Threading.Thread.CurrentThread.CurrentCulture = CultureInfo.GetCultureInfo("en-GB");
Was on a whim from google and have no idea on the impact, prior to this line of code theres no reference to any threading, it's just a straight up small time application.
Currently using a mixture of VS2012 Pro and VS2012 Express (Depending what machine I am using), using .NET4.0