What’s Trace Got To Do With Culture?

March 29, 2008

no comments

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.

Add comment
facebook linkedin twitter email

Leave a Reply

Your email address will not be published.

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>

*