سؤال

Error is as follows:
C:\Users\[username]\Google Drive\VS2010\Projects\[project name]\[project name]\Views\Show\EditOrder.cshtml: ASP.NET runtime error: Could not load file or assembly 'EntityFramework (1)' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference.

Hey all,
Got a strange problem here. seemingly randomly my project completely borked itself. A little bit of background: It's a ASP.Net MVC3 (.Net Framework 4) project that I mostly authored in Visual Web Developer 2010 Express. I say mostly because you'll note in the verbose error above I've stored it on my Google Drive. I'm syncing this project back and forth to my new development laptop, with an install of Visual Studio 2010 Professional. This probably isn't a great idea, but I wanted a simple method of working on it here on my desktop (at the office), at home (on my dev laptop), and on the road (again, dev laptop.)

Any ideas on what might have happened, and how I can fix this?

Bit more of background, now that I'm remembering this ... I had issues publishing it to our local IIS 6 server. I realized I had to add the _bin_deployableAssemblies to the package for it to work. At some point, I had deleted them from the project and re-added them. It was probably around that time, or at least within a few hours, that this issue started happening.

I can has halp?

هل كانت مفيدة؟

المحلول 2

Bloody strange ..

Looking in my /[Project Name]/bin folder I found 4 strange files:

EntityFramework (1).dll
EntityFramework (1).xml
[Project Name] (1).dll
[Project Name] (1).pdb

In any case, after deleting them guys and doing a Rebuild, all is well!

(Anyone have any ideas as to how or why this happened? Might be a Google Drive issue, now that I'm thinking about it ...

نصائح أخرى

Your MVC 3 project has a reference to one version of Entity Framework, but actually finds a different version when attempting to resolve the reference to Entity Framework on the computer where you get this error.

The simplest solution is probably to update to the current version of Entity Framework on your current computer, where you get the error.

If you open your project's .csproj file in a regular text editor (e.g. Notepad) you should see a line similar to this one:

<Reference Include="EntityFramework, Version=4.3.1.0, Culture=neutral, PublicKeyToken=b77a5c561934e089, processorArchitecture=MSIL">
  <SpecificVersion>False</SpecificVersion>
  <HintPath>..\packages\EntityFramework.4.3.1\lib\net40\EntityFramework.dll</HintPath>
</Reference>

That will tell you the version your application is expecting to find. If you see

<SpecificVersion>False</SpecificVersion>

then the expected version or a later version can be used.

Another way to resolve this kind of loading issue is using the Fusion Log Viewer, which will show you binding attempts that fail and what the loader tried (make sure you run it as Administrator or it will silently just do nothing).

It was a Google Drive issue for me. If you remove all files ending with (1) in your Project/bin folder it should resolve the problem.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top