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!
Thanks for this! I wasted a good few hours trying to figure this out. Your post solved it!
Thank you!
It did turn out there was another (test) domainservice hanging around somewhere…
I think you saved me hours of work!
Thanks,
I had same problem because I named my DomainService class exactly the same and I was struggling with this error about an hour.
Pingback: 2010 in review « Mattias Fagerlund's Coding Blog