Fixing broken Azure Unit tests

The following in a unit tests app.config will break mstest

<trace>

<listeners>

<add type=”Microsoft.WindowsAzure.Diagnostics.DiagnosticMonitorTraceListener, Microsoft.WindowsAzure.Diagnostics, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35″ name=”AzureDiagnostics”>

<filter type=”” />

</add>

</listeners>

</trace>

In the IDE it will report:

An exception occurred while invoking executor ‘executor://mstestadapter/v1’: Object reference not set to an instance of an object.

In mstest it will report:

Unit Test Adapter threw exception:

Could not create Microsoft.WindowsAzure.Diagnostics.DiagnosticMonitorTraceListener, Microsoft.WindowsAzure.Diagnostics, Version=1.8.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35.

Not running in a hosted service or the Development Fabric..

Leave a comment