DCSIMG
What's Trace Got To Do With Culture? - Doron's .NET Space

What's Trace Got To Do With Culture?

I really don't know the answer to that question, but we've hit the strangest issue. The following code runs well when <trace enabled="true"> is set on web.config, but throws FormatException when it's set to false.

DateTime.Parse(DateTime.Now.ToString());

We're thinking that somehow trace affects the system's culture, causing the code work. But it still doesn't make any sense to us. Looking in debug, it seems that DateTime.Now.ToString returns "DD" instead of the day, altought the current culture is "en-US". Can you make anything of it? Oh, and I should mention, this happens only on Windows 2000 Professional. When we run the software on Windows 2003 the problem does not reoccur.

Published Saturday, March 29, 2008 3:23 PM by dorony

Comments

No Comments

Leave a Comment

(required) 
(required) 
(optional)
(required) 

Enter the numbers above: