Work Journal 2013-jan-11

While helping temporary colleague Lars on a WCF problem I came to think of the tool logparser which I heard about recently in on .NET Rocks with Steve Evens (@scevans).

Here is a fantastic blog on examples of what you can do with logparser. There is also a GUI (from Lizard labs that has charting tools.

The bug in the WCF service that Lars experienced was quite evil. The service responded correctly when asked for xml data, but the server simply aborted the connection when asked for JSON. After changing the logging level to “Debug” and a site restart it was apparent that it was not a routing problem - The handler code did get hit as it was supposed to. However no exceptions showed up in the log.

Adding logging of the service as described in this stack overflow answer shed some light on the real problem. WCF appears to used the DataContractJsonSerializer by default and it does not work well with DateTime.MinValue in some cases (where it throws an exception).

This all sparked a discussion on JSON serializers for .NET and their status in the framework. I recalled that the JavaScriptSerializer - the only javascript serializer I have used in .NET - had been been deprecated and thus it surprised me quite a bit that it was not (in .NET 4.5) as pointed out by temporary colleague Daniel. It turns out that we were probably both right, since it was first deprecated in .NET 3.5 in favor of the DataContractJsonSerializer and then undeprecated in .NET 3.5 SP1 according to Dan Rigsby (broken link - sorry…) (@DanRigsby). Another post about the status of .NET’s JSON serializers:

Work Journal – a diary on what I did work/programming related today.