Browse by Tags
All Tags »
.NET Framework (
RSS)
I’ve hit a weird issue today. We have a service that we run both as Windows service and from console. A specific use case seemed to cause our system to hang, but only when running from console. Also, I was sure this didn’t happen before I upgraded my machine to .NET 4.5. The service initialization code looks something like this: serviceHost.Open(); while (Console.ReadKey().Key != ConsoleKey.Q) { Console.WriteLine( "Press Q to exit" ); } Basically, we start a WCF service, and wait...
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"...
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...
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....