System.ServiceModel.ProtocolException: An HTTP Content-Type header is required

Posted on May 19, 2010

The full exception message is “An HTTP Content-Type header is required for SOAP messaging and none was found.”. If you’re writing a WCF service that returns Entity Framework entities, you may run into this error in your client application. To correct it, open your EDMX file in the service project and change the Lazy Loading Enabled property to False. It makes sense that related entities can’t be lazy-loaded after the query results ...

Read More


Silverlight 3 Navigation: My HyperlinkButtons don’t work!

Posted on January 17, 2010

The navigation framework of Silverlight 3 is great.  The URI mapping and browser history support add a lot of value. When upgrading a Silverlight 2 site to use Silverlight 3 with navigation, I was surprised to see that all of my HyperlinkButtons that referenced external URLs were failing! It turns out that once your HyperlinkButton is inside of a navigation frame (which it will be once you add navigation support to your application), you ...

Read More


.NET 101

Posted on October 26, 2009

If you find yourself wanting yourself to share some C# brilliance related to… The difference between Object.Equals() and == How string comparison is an interesting special case Why class instance memory is not necessarily reclaimed when an instance goes out of scope Which of Stream.Close() and Stream.Dispose() should be called (or both) Please remember that it is not 2001.  Everyone knows these things (unless you’re in a ...

Read More


Doing the dishes

Posted on October 2, 2009

While washing all of the coffee cups left in the office sink by others this morning, I was reminded of a lot of code I’ve seen lately. How often do you open up a piece of code in Visual Studio to find something implemented in a completely ad hoc way, or only half done?  Swaths of code commented out, TODOs sprinkled throughout, all sorts of unrelated concerns mixed in. These are dishes in the sink.  Someone went home early to get their ...

Read More


Where are the recent items in my Windows 7 jump list?

Posted on October 1, 2009

I just started adding support for the Windows 7 taskbar jumplist to my WPF application, using the excellent .NET wrappers in the Windows API Code Pack. After creating the jump list, file selection via the Windows common file dialogs should automatically cause entries to appear in the Recent section of the jump list. But no.  What's going on? It turns out that everything is working as expected.  However, you need to have the "recent ...

Read More