awrigley
awrigley

Reputation: 13581

EF 4.1 to EF 4.3.1: Something is still referencing 4.1, but can't find it

Setup:

I have an app that is a copy of another app, that worked with EF 4.1. In the new app, I have added a nuget package reference to EF 4.3.1 in a domain project.

All works on my local machine, but on the server throws the following error:

Could not load file or assembly 'EntityFramework, Version=4.1.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)

Clearly, something is still referencing the old entity framework 4.1, but the only dll it finds is the EF 4.3.1 dll.

There are no references to EntityFramework in the web.config.

Question:

How do I find what is still referencing the old dll?

I have removed all EF references from all projects in the solution and added the EF 4.3.1 package to each project, but still no joy.

Notes:

I could try a binding redirect using the dependentAssembly (see accepted answer in this SO question)

However, I can't find what names and tokens to use.

Still, it would be better to get to the route of the problem, rather than just redirecting a binding.

Upvotes: 0

Views: 1187

Answers (1)

greg84
greg84

Reputation: 7599

Have you recompiled the application after changing the reference, or just uploaded the new EntityFramework.dll file? It's possible the application's library is still referencing the old version in your production environment. Do a re-compile and re-publish.

EDIT (see comments) : Open all your .csproj files in notepad and look for the Reference tags, double check that the old version doesn't exist in all the projects.

Upvotes: 4

Related Questions