2012-03-21 41 views
3

上的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. 

回答

0

我想你的問題與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

相關問題