DCSIMG
.NET Framework - Doron's .NET Space

Browse by Tags

All Tags » .NET Framework (RSS)

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"...
Posted by dorony | with no comments

Upgrading to .NET 2.0? PowerCollections to your Aid.

The .NET 2.0 framework has been here a while, but if you're like my team, you're still using a lot of code that you wrote back at the .NET 1.1 days. It's likely that many of these methods are using non-generic collections. This poses an annoying issue. Check out this method: public IList GetAllUsers(IList userCodes) { IList list = new ArrayList(); // Add the users here... // ... return list; } On the one hand, you don't want to touch the older code. It is working, it doesn't have unit-tests, and...

IsolatedStorage to the Rescue

Up until recently I've been totally unaware to an extremely useful .NET feature known as IsolatedStorage . It goes like this. Let's say you have a client application, right? And that application needs to store some data, right? Some user preferences maybe. Thing is, trying to simply write that data into a file can be a problem. Your application might not have the permissions needed to write to the file system. In fact, if we're talking about a browser application, that's a very likely situation....
Posted by dorony | with no comments