Trouble with the VS QualityTools.UnitTestFramework dll
2 min read
2 min read
I recently build a tool that automates and simplifies the unit testing of large parts of our application's business layer. The system works by declaratively specifying scenarios in xml files which are read by using the MS test's data driven test cases and validated against a set of "business rules". The tool is tailored to our company internal development model and dramatically increases the speed with which the BL layer can be tested.
I integrated the unit testing facility in our class library which required me to include the Microsoft.VisualStudio.QualityTools.UnitTestFramework as I needed some of its functionalities. Now since our class library was developed when using VS2008, the referenced version of the UnitTestFramework was 9.0.0.0. It worked fine so far until recently one of my work mates was calling me due to a problem with the tool. While for others everything worked perfectly, he got the following exception when launching the tests:Test method Company.Project.BusinessLogic.UnitTests.ValueBLUnitTest.TestValidateValueBLRules threw exception:The problem was basically that he didn't have VS2008 installed on his machine. Hence, the v9.0.0.0 of the UnitTestFramework.dll wasn't present, but just the VS2010 v10.0.0.0.
System.IO.FileNotFoundException:
Could not load file or assembly 'Microsoft.VisualStudio.QualityTools.UnitTestFramework, Version=9.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].
<?xml version="1.0" encoding="utf-8" ?>While this is certainly not an optimal solution it does the job for now.
<configuration>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="Microsoft.VisualStudio.QualityTools.UnitTestFramework" publicKeyToken="b03f5f7f11d50a3a"/>
<bindingRedirect oldVersion="9.0.0.0" newVersion="10.0.0.0"/>
</dependentAssembly>
</assemblyBinding>
</runtime>
</configuration>