Viewing System.Diagnostics.Trace Entries in the Windows Azure Compute Emulator

Windows Azure Cloud Services have some fantastic diagnostics capabilities that leverage those provided by Windows and the .NET Framework.

If you are creating a Web Role, and would like to be able to easily view trace information in the Compute Emulator during debug sessions on the local machine, you may find that the trace entries don’t appear by default. 

To fix the problem, you simply need to add an entry to your web.config inside the web project.

<configuration>
  <system.diagnostics>
    <trace>
      <listeners>

        <add type="Microsoft.ServiceHosting.Tools.DevelopmentFabric.Runtime.DevelopmentFabricTraceListener, Microsoft.ServiceHosting.Tools.DevelopmentFabric.Runtime, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
             name="DevFabricListener">
          <filter type="" />
        </add>

      </listeners>
    </trace>
  </system.diagnostics>
</configuration>

Leave a Reply