0 out of 2 rated this helpful - Rate this topic

How to View Trace Information in the Compute Emulator

Updated: November 22, 2010

You can use the System.Diagnostics.Trace object to display information about your running service in the user interface of the Windows Azure compute emulator.

To display trace messages

  1. In Visual Studio, open the source file for the role.

  2. Add the following Using statement:

    using System.Diagnostics;
    
  3. In the Run method, add the Trace.WriteLine statement. The following example shows an example of the Run method:

    
    public override void Run()
    {
       Trace.WriteLine("WorkerRole2 entry point called", "Information");
       
       while (true)
       {
          Thread.Sleep(10000);
          Trace.WriteLine("Working", "Information");
       }
    }
    
  4. Build and run your service.

  5. Right-click the Windows Azure icon in the system tray, and then click Show Compute Emulator UI.

    The left pane of the user interface shows the services that are currently deployed and the role instances that are running for each service. You can click on the service or roles to see the trace information in the right pane. If an service has multiple role instances running, you can click the top margin of a message window to maximize it in the pane.

Did you find this helpful?
(1500 characters remaining)

Community Additions

© 2013 Microsoft. All rights reserved.