Search code examples
c#jenkinsvisual-studio-2015mstestjenkins-mstest

Error while running unit test cases through Jenkins: Could not load file or assembly 'Microsoft.QualityTools.Testing.Fakes, Version=11.0.0.0'


Written unit test cases using MS Test Framework for our project which is on C# and using Fakes to bypass the DB call. Test cases are running fine in Visual Studio 2015. But when try to run through Jenkins Job it’s giving below error message:

Error Message: Test method threw exception: System.IO.FileNotFoundException: Could not load file or assembly 'Microsoft.QualityTools.Testing.Fakes, Version=11.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot find the file specified.WRN: Assembly binding logging is turned OFF. To enable assembly bind failure logging, set the registry value [HKLM\Software\Microsoft\Fusion!EnableLog] (DWORD) to 1. Note: There is some performance penalty associated with assembly bind failure logging. To turn this feature off, remove the registry value [HKLM\Software\Microsoft\Fusion!EnableLog].

Could anyone please guide to fix the above error.


Solution

  • The root cause of the issue - Microsoft.QualityTools.Testing.Fakes version 11.0.0.0 was missing in bin/debug in Git repository. Additionally all dll's which are referred for unit test project needs to manually added under bin/debug folder in the Git