views:

241

answers:

1

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 version 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.

+1  A: 

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.

Craig Stuntz