是否可以在项目中一起使用RIA Services和EntityFramework.Migrations?

问题描述:

上的NuGet有包:是否可以在项目中一起使用RIA Services和EntityFramework.Migrations?

EntityFramework.Migrations
EF 4.3.1
EF 4.1
RIA服务,它依赖于EF < 4.2。

EntityFramework.Migrations不起作用,因为它现在包含在EF 4.3+

我使用的代码第一次的做法,所以我需要DbDomainService <>类,它是不可用的,当RIA服务没有安装。

有没有任何独立的下载,以上述手动引用我的项目?

编辑

我删除RIA从包的NuGet,updgraded EF 4.3.1,然后手动引用从工具箱RIA的EntityFramework lib中的建议在这里:Unfortuately现在我得到Can I use RIA Services with Entity Framework 4.3?

以下错误:

The following exception occurred creating the MEF composition container: 
Unable to load one or more of the requested types. Retrieve the LoaderExceptions property for more information. 
The default code generator will be used. 

我想你的问题与Ria服务的T4代码生成器有关。
然而,您可以了解它不能加载附加调试器的类型(如果您使用VS,请不要忘记在客户端组件(msbuild MyClientProjectThatContainTheProxy.csproj)的编译中将所有抛出的CLR异常中断)。
但是,如果你只是想“试一下”,把这个

<runtime> 
    <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1"> 
     <dependentAssembly> 
     <assemblyIdentity name="EntityFramework" publicKeyToken="b77a5c561934e089" culture="neutral" /> 
     <bindingRedirect oldVersion="0.0.0.0-5.0.0.0" newVersion="4.3.1.0" /> 
     </dependentAssembly> 
    </assemblyBinding> 
    </runtime> 

在你的web.config,告诉CLR如何解决depndencies 这里更多的信息:http://mcasamento.blogspot.it/2012/10/entity-framework-5-code-first-and-wcf.html