Could not load file or assembly 'EntityFramework, Version=4.1.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' or one of its dependencies

StackOverflow https://stackoverflow.com/questions/18701660

Question

I am getting this error in a WCF web service when the program attempts to use a method that employs the entity framework. However, we know that the server has the entity framework (correct version) installed because it is hosting another WCF web service and an intranet site that use it successfully.

I've tried to set copy local to true, however this simply compiles the Entity Framework dll into the debug/release folder of the project that uses it, not the web service project that gets deployed (the project that gets deployed contains a references the project that uses the entity framework).

Has anyone run into this kind of issue before and know a work-around either with or without using copy local?

Was it helpful?

Solution

The solution to this problem was to simply place the EntityFramework.dll and .xml file generated in the bin of the project that uses the Entity Framework and place that in the bin of the service project that was being deployed.

OTHER TIPS

Check to see that the Application Pool for the IIS Site in question is set to use to correct .NET Framework version. In the case of EF 4.1, the Application Pool should be running on .NET Framework version 4 or higher.

To identify the version of .NET being used by the site, first find out the Application pool in use (in IIS, click on Basic Settings for the site), then identify the appropriate pool under the Application Pools node. The .NET Framework version should be listed.

Check whether bit versions are compatible between entity framework and server. If the server is 64 bit and you are using 32 bit entity framework dll you can get this error. Then change app pool setting to enable 32 bit applications.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top