WCF Service Host implementers beware

Jon Flanders has a great and very detailed post about implementing your own ServiceHost by extending ServiceHostBase instead of ServiceHost when using WCF.

He points out what I believe to be a serious flaw, not with the design of WCF and ServiceHost, but rather the implementation of the two. It turns out ServiceHostBase relies on specific behavior of ServiceHost. This is a typical OO no-no. Jon describes it very well and calls it a “magic method”. I just call it a mistake.

It is disappointing to think that there was not a CanInheritFromServiceHostBase test case out there in WCF-land somewhere. <snarky>I guess it was too difficult to write with mstest, and they weren’t allowed to use NUnit or MbUnit</snarky> 🙂

update: A link to the post would be helpful. 🙂

1 thought on “WCF Service Host implementers beware”

Comments are closed.