While my main application works fine, the unit test project is giving following error, when I try to execute “Mapper.AddProfile” method in initialiation of unit test project.
The type initializer for ‘Foolproof.ContingentValidationAttribute’ threw an exception.
Could not load file or assembly ‘System.Web.Mvc, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35’ or one of its dependencies. The located assembly’s manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)
I have not used MVC 2.0.0.0 anywhere in my main project, and test project as well. Both these projects refer to MVC 4.0.0.0
what could be the possible issue?
Looks like the MVCFoolProof project has a reference to MVC2. See here: CodePlex Source Code – you could try pulling the source down and compiling it yourself against MVC4.