1

After adding the latest version of FluentValidation.MVC3 to a NopCommerce aplication i am receiving the following error,

 [Exception: Could not load file or assembly 'FluentValidation, 
 Version=3.2.0.0,Culture=neutral, PublicKeyToken=a82054b837897c66' or one 
 of its dependencies. The located   assembly's manifest definition does not 
  match the assembly reference. (Exception from  HRESULT: 0x80131040)
 ]
   Nop.Core.Plugins.PluginManager.Initialize() 
in C:\Nop 2.2 Source -Copy\just4fashion2.2source\Libraries\Nop.Core\
Plugins\PluginManager.cs:144

I think this is due to the project referencing an older version of the fluent validation dll but im not sure how to fix this, is there a way to pinpoint the error further?

Any advice you can offer will be much appreciated.

jcopenha
  • 3,935
  • 1
  • 17
  • 15
Liam
  • 455
  • 2
  • 7
  • 22

1 Answers1

1

You might find this post helpful on how to track down dependencies in your application. I think you're absolutely right that either your project or a dependency your project is taking references an older version of FluentValidation.

Another thought is if you add the dependency to FluentValidation.MVC3 via NuGet, NuGet tends to place assembly binding redirects in the web.config. This will tell any assemblies with a hard dependency on an older version of an assembly to "redirect" to the latest version.

Community
  • 1
  • 1
Brandon Linton
  • 4,373
  • 5
  • 42
  • 63
  • Unfortunately for some reason using the MVC5 NuGet package is not adding the redirect into web.config as I would have hoped. I don't even know why its trying to load version 3.x if I just installed 7.x. Weird? – Piotr Kula Jun 06 '17 at 13:53