Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Encountered an error hydrating the EDMX file?

I just got the Visual Studio 2012 RC Ultimate and I'm trying to connect to a database using EntityFramework Database First. I've created the EDMX file like I've done a thousand times and when I build my project I get 2 errors. I'm not sure if they are related or not.

Encountered an error hydrating the EDMX file 'Model.edmx'.

Could not load file or assembly 'Microsoft.Data.Tools.Schema.Sql, Version=11.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot find the file specified.

I've spent several hours on Google trying to see if anyone else has had this issue and I'm not finding anything at all.

Any help would be great. Thanks

like image 302
Kevin Avatar asked Jun 06 '12 03:06

Kevin


2 Answers

  1. close all instances of Visual Studio
  2. delete the file C:\Program Files (x86)\MSBuild\4.0\Microsoft.Common.targets\ImportAfterMicrosoft.Data.Tools.Integration.targets
  3. restart Visual Studio & rebuild solution

i hope this saves someone a lot of trouble like it could have for me -ck

update:

apparently this is only an issue if you installed VS2012RC over the top of VS2012 Developer Preview, as something was removed / renamed and that file remains from the old install and wreaks havoc...

like image 133
ckozl Avatar answered Oct 06 '22 23:10

ckozl


Big thanks to divega about pointing me in the right direction with his answer on this post

EntityHydrate task failed

Look for his answer there, just simply remove this file and everything works perfectly

C:\Program Files (x86)\MSbuild\4.0\Microsoft.Common.Targets\ImportAfter\Microsoft.Data.Tools.Integration.targets

like image 25
Kevin Avatar answered Oct 07 '22 00:10

Kevin