开发者

ASP.Net MVC 2 / EF 4 Reference Issue

开发者 https://www.devze.com 2023-01-02 18:10 出处:网络
My ASP.Net MVC 2 project references a Domain project where POCO business objects are defined and a Data project where EF 4 POCO persistence is implemented.

My ASP.Net MVC 2 project references a Domain project where POCO business objects are defined and a Data project where EF 4 POCO persistence is implemented.

Things were running well until I had a little fussiness with my ver开发者_C百科sion control provider (rollback to previous version left me with merge conflicts). Now, upon launching the MVC 2 project, I get a runtime error:

The type 'System.Data.Objects.DataClasses.IEntityWithKey' is defined in an assembly that is not referenced. You must add a reference to assembly 'System.Data.Entity, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'.

However, every project references System.Data.Entity (same version).

If I remove the reference to System.Data.Entity from the MVC 2 project, I get the same message as a compile-time error.

I'm pretty sure something got messed up when I had the version control issue, but really not sure where to look for this one.


The issue is coming from the ASP.NET compiler, not the VS compiler.

You need to add System.Data.Entity to the assemblies section in system.web, compilation in web.Config.

0

精彩评论

暂无评论...
验证码 换一张
取 消