0

All of a suddon, I'm getting a FileLoadException when getting an instance of a class from Ninject.

The exact exception is the following:

System.IO.FileLoadException: "Could not load file or assembly 'Quartz, Version=2.3.3.0, Culture=neutral, PublicKeyToken=f6b8c98a402cc8a4' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)"

When reading the error message, it seems quite clear that it tries to load an assembly of Quartz with version 2.3.3.0 but the specified version is another... but I don't get why it even loads version 2.3.3.0.

I searched the whole solution (inclusive the .csproj) for Quartz references and every reference states v1.0.1.2. I've searched the path on the file system for Quartz.dlls but could only find dlls of version 1.0.1.2 so I don't understand why it tries to load 2.3.3.0.

Do you know of any steps I could try to solve this exception?

Thanks in advance

Jester
  • 56,577
  • 4
  • 81
  • 125
xeraphim
  • 4,375
  • 9
  • 54
  • 102
  • may be dup of http://stackoverflow.com/questions/215026/the-located-assemblys-manifest-definition-does-not-match-the-assembly-reference?rq=1 – Neel Aug 31 '15 at 12:04
  • See also [How to enable assembly bind failure logging](http://stackoverflow.com/questions/255669/how-to-enable-assembly-bind-failure-logging-fusion-in-net). – Jester Aug 31 '15 at 12:05
  • Something must have changed. A new version deployed, maybe a nuget package was updated. Can you tell us what changed? – jvilalta Sep 02 '15 at 21:49

2 Answers2

0

Check the class library that includes Quartz. Make sure that the platform version is consistent. You can do this by right clicking on the project file and selecting properties. Then check the assembly version in the first/top most tab.

Whatever platform version you have in that class library should be consistent with the other projects in the solution.

TheEdge
  • 9,291
  • 15
  • 67
  • 135
0

This happens when you install some other nuget package (like Quartz.Unity) which depends on Quartz. While installing that other package if you select 'lowest' option for dependency then it would set Quartz 2.3.3.0 as dependency. However, you have Quartz 2.4.1 installed in your package. So you get the error.

Solution: While installing that other package select 'highest' option for dependency if you have highest version installed in your project.

Prakash
  • 789
  • 6
  • 9