Silverlight and “entity type … is exposed…” Error

I just created a Domain Sevice Class for my Silverlight application – and I couldn’t figure out a good name for it so I decided to keep the default name. Or rather, instead of calling it “DomainService1.cs” I’d call it “DomainService.cs”. Big mistake.

So, what the heck is going on? I only have the one DomainService, so whatever’s going on, the error message is incorrect!

After loads and loads of debugging, tweaking and testing, it turns out that there is another class named DomainService. It’s located in another namespace, but that doesn’t matter, it confuses the heck out of some part of Visual Studio (RIA?).

Renaming the DomainService to something else solved the problem. Live and learn!