Silverlight and “entity type … is exposed…” Error
March 17, 2010 4 Comments
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.
I immediately got the following cryptic error messages;
Error 1 The entity type ‘BusinessApplication2.Web.Catalog’ is exposed by multiple DomainService types. Entity types cannot be shared across DomainServices. BusinessApplication2
Error 2 The entity type ‘BusinessApplication2.Web.Image’ is exposed by multiple DomainService types. Entity types cannot be shared across DomainServices. BusinessApplication2
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!