Sunday, November 14, 2010

WCF Extension element cannot be added to this element – brought to you by “whitespace counts” orthodox or just a lax man?!

It was not the first time I stumbled upon “Extension element 'X' cannot be added to this element. Verify that the extension is registered in the extension collection at system.serviceModel/extensions/Y.” But as always, the knowledge last used longer than a year ago just goes away.

I know I should put a fully qualified name into the extension type even if mine is not strong named. Quite stupid from my opinion to do so anyway, but I learnt my lesson for this 3 years ago, so what the heck it is now?

So if I put by chance an extra whitespace or forgot to use one where required, I’ll be punished with the error above and … And I don’t exactly agree with engineer that made such a design decision I should say.

If we count the time such an engineer is incorporating into his design decision, time “wasted” by his fellow dev users, my message to the guy would be - Provide a better error message or risk joining the collection of stupid and useless error messages here:

As I guess discussion about significance of whitespaces here could be very long!