Hi,
I'm working on a large .NET extension, which (amongst other things) produces reports. This addin is being used all over the world. The reports should be produced in the users' local culture.
So, before generating the reports, I set the Thread.CurrentThread.CurrentUICulture and the .CurrentCulture properties to the appropriate cultures. This works fine in AutoCAD 2010 and 2012. In 2014 it works fine as well, but when closing AutoCAD, I get an unhandled exception.
I reproduced the issue with the following command code:
<CommandMethod("MyTestCommand", CommandFlags.Session)> Public Sub MyTestCommand() Dim cultureInfo = New CultureInfo("nl-nl") Thread.CurrentThread.CurrentUICulture = cultureInfo MessageBox.Show((0.2).ToString()) End Sub
What am I doing wrong here?
Thanks in advance!
Regards,
Matthijs ter Woord
You probably just need to revert the changes... check this example: http://adndevblog.typepad.com/autocad/2012/06/autocad-keeps-overriding-currentculture-and-currentuic...