VSTS Unit Tests: will debug but not run?

We have found a weird situation where for a certain vs.net solution, you can debug a vsts unit test but cannot run them.  When you try to run them you get this error:  (for all tests)

Unit Test Adapter threw exception: System.Reflection.ReflectionTypeLoadException: Unable to load one or more of the requested types. Retrieve the LoaderExceptions property for more information..

Now, I looked at the Assembly Binding Log using fuslogvw.exe and found 6 entries.

Application Description Date/Time
 vstesthost.exe  Microsoft.VisualStudio.QualityTools.Common, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a  11/10/2005 @ 9:48:54 PM
 vstesthost.exe  Microsoft.VisualStudio.QualityTools.ExecutionCommon, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a  11/10/2005 @ 9:48:53 PM
 vstesthost.exe  Microsoft.VisualStudio.QualityTools.AgentObject, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a  11/10/2005 @ 9:48:53 PM
 vstesthost.exe  Microsoft.VisualStudio.QualityTools.Tips.UnitTest.ObjectModel, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a  11/10/2005 @ 9:48:54 PM
 vstesthost.exe  Microsoft.VisualStudio.QualityTools.Tips.UnitTest.Adapter, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a  11/10/2005 @ 9:48:53 PM
 vstesthost.exe  msvcm80, Version=8.0.50608.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a  11/10/2005 @ 9:48:53 PM

I am guessing that it can’t find assemblies like: Microsoft.VisualStudio.QualityTools.Common.dll, which reside in this directory: C:\Program Files\Microsoft Visual Studio 8\Common7\IDE\PrivateAssemblies

Anyone else ever run into this?

 ** UPDATE **

I found a fix:  I removed the reference to Microsoft.VisualStudio.QualityTools.UnitTestFramework in my unit test assembly and re-added it. 

 

Recent Posts

Tag Cloud

4 Comments

  • Refreshing the "Test View" fixed this for me. Removing and re-adding the reference to Microsoft.VisualStudio.QualityTools.UnitTestFramework didn't solve my particular problem.

  • I just had this issue appear whenever I activated the code coverage functionality. Setting the singing key file in the code coverage dialog page solved it...

  • I also removed and re-added the reference without luck. Then I refreshed the test view and it worked.

  • I am working on VS2008 and using load test on stored procedure by passing two parameters through csv file.I have given the configuration as in app config after load test it shows an error"Unit Test Adapter threw exception: The type initializer for 'Microsoft.VisualStudio.TestTools.UnitTesting.TestConfiguration' threw an exception. An error occurred creating the configuration section handler for microsoft.visualstudio.qualitytools: Could not load type 'Microsoft.VisualStudio.QualityTools.UnitTesting.Framework.TestConfigurationSection' from assembly 'Microsoft.VisualStudio.QualityTools.UnitTestFramework, Version=9.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'. (C:\WorkSpace\VSTS_Demo\TestResults\Administrator_WIN-8LRYO7OOQCL 2010-01-27 19_45_48\Out\VSTS_Demo.dll.config line 4) Could not load type 'Microsoft.VisualStudio.QualityTools.UnitTesting.Framework.TestConfigurationSection' from assembly 'Microsoft.VisualStudio.QualityTools.UnitTestFramework, Version=9.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'..

    Exception LoadTestErrorLimitExceededException 1 More than 1000 errors of type 'TestError' and sub type 'TestError' have occurred; additional errors of this type will not be reported.

    "

    In App.Config file:

    <?xml version="1.0" encoding="utf-8" ?>

    <configuration>

    <configSections>

    <section name="microsoft.visualstudio.qualitytools" type="Microsoft.VisualStudio.QualityTools.UnitTesting.Framework.TestConfigurationSection, Microsoft.VisualStudio.QualityTools.UnitTestFramework, Version=9.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />

    </configSections>

    <connectionStrings>

    <add name ="MyConnectionString" connectionString="Driver={Microsoft Text Driver (*.txt; *.csv)};Dbq=C:\WorkSpace\VSTS_Demo\VSTS_Demo\;Extensions=asc,csv,tab,txt"

    providerName="System.Data.Obdc" />

    </connectionStrings>

    <microsoft.visualstudio.qualitytools>

    <dataSources>

    <add name="MyDataSource" connectionString="MyConnectionString" dataTableName="ChildSearchCriteria" dataAccessMethod="Sequential" />

    </dataSources>

    </microsoft.visualstudio.qualitytools>

    </configuration>

Comments have been disabled for this content.