代码改变世界

Ambiguous Reference in Generated Code

2011-09-06 20:13  starlet  阅读(305)  评论(0编辑  收藏  举报
     I have two models that point to two different databases in seperate namespaces in my web project with entities of the same Type. I also have two seperate DomainServices, one for each model. My generated code in my SL application is receiving an error saying my Entity is an ambiguous reference because it can't tell whether to look at the entity in namespace A or namespace B. One of the generated code classes for the entity in namespace A uses the full type namespace and works fine (public EntitySet<SDInfo.Web.Models.Replicated.SiteInformation> SiteInformations). However, the generated code class for namespace B does not use the full name and is the one causing the error (public EntitySet<SiteInformation> SiteInformations). I found the suggested answer below, but wanted to see what you guys thought first. Thanks.

1. Open the Silverlight client .csproj in Notepad
2. Add this line to one of the PropertyGroups (or create a new PropertyGroup)
    <RiaClientUseFullTypeNames>true</RiaClientUseFullTypeNames>

Found here: http://connect.microsoft.com/VisualStudio/feedback/details/560675/ambiguous-reference-in-generated-code-for-client-domain-services