How to fix the "Unable to find assembly Microsoft.VisualStudio.QualityTools.LoadTest ..." error when running your unit-tests

For an older MVC project I wrote unit-tests with the MSTest framework. Visual Studio requires a .testsettings file in your project, which contains the configuration for the unit-tests.

When running or debugging unit-tests there might be the case that the “Unable to find assembly Microsoft.VisualStudio.QualityTools.LoadTest …” error is logged and the test is getting skipped. In order to correct this issue you have to check inside the .testsettings file for the WebTestRunConfiguration section.

Here is an example of this section:

1
2
3
4
5
6
7
8
9
10
11
12
<WebTestRunConfiguration testTypeId="...">
    <Browser name="...">
        <Headers>
        <Header name="User-Agent" value="..." />
        <Header name="Accept" value="..." />
        <Header name="Accept-Language" value="..." />
        <Header name="Accept-Encoding" value="..." />
        </Headers>
    </Browser>
    <Network Name="..." BandwidthInKbps="..." />
    ...
</WebTestRunConfiguration>

This section causes the error and is the configuration for load tests (here is an article about this type of tests){:target=”_blank”}. If you do not have load tests in your project you can remove it. After that you can run or debug your unit-tests again.

comments powered by Disqus