0

I found a problem within Entity Framework. I downloaded the code and fixed the issue, and finally compiled the assemblies. Now i have been struggling for hours but I can't figure out HOW to use my assemblies in my project. I tried to overwrite the assembly in the packages folder but whenever I try to execute commands from the package manager I get errors like

"Unable to load file or assembly 'EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' or one .... The assembly's manifest definition does not match the assembly reference. (Eccezione da HRESULT: 0x80131040)".

The same happens when running my project.

EDIT: I tried also to find and replace any revelant (not all) occurrences of Microsoft PublicKeyToken in EntityFramework.dll, EntityFramework.PowerShell.dll and replace them in packages folder. Nothing. Tried to modify any references in .csproj, app.config. nothing.

How can I solve the problem and use my EntityFramework.dll both in project and Package Manager? Thanks

lorenzop
  • 525
  • 4
  • 19
  • `The assembly's manifest definition does not match the assembly reference.` http://stackoverflow.com/q/19811009 – Robert Harvey Mar 18 '14 at 23:16
  • if you're not doing a nuget package update and doing it manually, try removing the reference to the old DLL and adding the reference to the new one. – Raja Nadar Mar 18 '14 at 23:17
  • @RobertHarvey my problem is about assembly PublicKeyToken. Not about version. – lorenzop Mar 18 '14 at 23:24
  • @raja Not working. Also tried to reference the project. However, that wouldn't impact package manager – lorenzop Mar 18 '14 at 23:25
  • That would have been my second guess. Does the assembly have to be signed, or can you just use an unsigned assembly and remove the public key token? – Robert Harvey Mar 18 '14 at 23:25
  • If it's a local copy then, since you modified it, there would be no public key token (since that's used for GAC assemblies). – Brian Mains Mar 18 '14 at 23:26
  • @RobertHarvey already tried both: new snk and no sign. The problem is that VS il always looking for THAT PublicKeyToken. – lorenzop Mar 18 '14 at 23:27
  • I assume you removed the old EF reference from your project first, before adding the new assembly reference. – Robert Harvey Mar 18 '14 at 23:29
  • @RobertHarvey obviously. Otherwise, I would have got duplicate definitions errors. – lorenzop Mar 18 '14 at 23:33
  • I'm a bit lost, then. If it's *your* assembly, and you are setting it up without signing, and you removed the old EF assembly reference, and you named your assembly something else so that it doesn't clash with the original assembly, and you gave it your own version number, and you specified the new assembly in the File/Open dialog when you added the new assembly to your project as a reference, then I don't see how it could possibly not work. – Robert Harvey Mar 18 '14 at 23:37
  • In fact my project compiles. But, while running, it continues to throw errors like the mentioned. The main problem, in addition, is that I can't use it in the Package Manager, essential for migrations. – lorenzop Mar 19 '14 at 06:56

0 Answers0