0

I have a WCF Service application that uses EntityFramework 5.0.0 and when I called the method that uses the EDMX framework I get the below given message.

The server encountered an error processing the request. The exception message is 'Could not load file or assembly 'EntityFramework, Version=5.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' or one of its dependencies. The system cannot find the file specified.'. See server logs for more details.

Here are my config snippets:

App.config

<?xml version="1.0" encoding="utf-8"?>
<configuration>
  <configSections>
    <!-- For more information on Entity Framework configuration, visit http://go.microsoft.com/fwlink/?LinkID=237468 -->
    <section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=5.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
  </configSections>
  <entityFramework>
    <defaultConnectionFactory type="System.Data.Entity.Infrastructure.LocalDbConnectionFactory, EntityFramework">
      <parameters>
        <parameter value="v11.0" />
      </parameters>
    </defaultConnectionFactory>
  </entityFramework>
</configuration>

Packages.config

<?xml version="1.0" encoding="utf-8"?>
<packages>
  <package id="EntityFramework" version="5.0.0" targetFramework="net45" />
</packages>

Web.config

<assemblyBinding>
      <dependentAssembly>
        <assemblyIdentity name="EntityFramework" publicKeyToken="b77a5c561934e089" culture="neutral" />
        <bindingRedirect oldVersion="0.0.0.0-5.0.0.0" newVersion="5.0.0.0" />
      </dependentAssembly>
</assemblyBinding>

Am I missing anything? What do I have to check?

Help Please!!

Muhammedh
  • 484
  • 1
  • 11
  • 25

2 Answers2

1

.NET 4.5 is required. However, EF5 will run on .NET 4 So you have to check that IIS Application pool is configured to support .Net FrameWork 4.0. For example: Sharepoint 2010 requires ASP.Net 3.5, so it does not support EF5.

Community
  • 1
  • 1
Ruslan Dayanov
  • 308
  • 3
  • 10
  • Your have to run Internet Information Service(IIS) Manger. Then navigate to "Your Server"-> "Application Pools". Here find application pool running your WCF application. Open it's context menu (right mouse button click) ->Base Settings->.Net Framework version – Ruslan Dayanov Sep 16 '14 at 11:08
  • I got to where you told me, I am using the SharePoint - 80 site to access my WCF service. The version is 4.0.30319. – Muhammedh Sep 16 '14 at 11:11
  • Your tip on FusionLog helped me alot.. I found out that the Service is searching for the dll in 80/bin. After I copied it there.. Im getting another error(http://stackoverflow.com/questions/20129769/cant-find-entity-framework-connection-string-in-app-config). Thanks getting me over this hurdle! – Muhammedh Sep 16 '14 at 13:04
0

Summary with the help of @Ruslan-Dayanov:

Configure and Use the Fusion Log Viewer to see where the service looks for the dll. Make sure the dll is available in that location.

References

Muhammedh
  • 484
  • 1
  • 11
  • 25