Tuesday, June 11, 2013

Windows Azure Logging not working Trace.TraceError throws: Not running in a hosted service or the Development Fabric.

I had the following line in my web.config:

<system.diagnostics>
    <trace>
      <listeners>
    <add type="Microsoft.WindowsAzure.Diagnostics.DiagnosticMonitorTraceListener, Microsoft.WindowsAzure.Diagnostics, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
   name="AzureDiagnostics">
     <filter type="" />
    </add>
      </listeners>
    </trace>
  </system.diagnostics>

After removing this: it created WAWSAppLogTable as expected.
More info can be found here: www.windowsazure.com


for local debugging I left the line untouched... I created a new config transformation where I added:

<system.diagnostics>
  <trace>
   <listeners>
    <add name="AzureDiagnostics" xdt:Locator="Match(name)" xdt:Transform="Remove" />
   </listeners>
  </trace>
 </system.diagnostics>


Which is quite logic since Azure websites is not hosted in the AppFabrik