Implementation and debugging of WCF services in Windows Azure

Source: Internet
Author: User
Keywords Windows AZURE WCF
Tags access application debugging file find program application service service in

Open Diagnostics

With the above application, most and diagnostics-related work is now done for us . But be sure to remember that we have to add "Sharedlistener" to "Azurelocalstorage". It's really easy to do this task simply by swapping the annotated "system.diagnostics" node in the "Web.config" file of the WCF Web role.

In addition, you must add the following line of code to the "WebRole.cs" file:

Diagnosticmonitor.start (Cloudstorageaccount.developmentstorageaccount, diagnosticconfig);

During the process of migrating logs to blobstorage using SDK 1.3, you may experience problems that are related to the permissions available on the files that are created as svclog. This is not a solution, first of all, you can imitate robindotnet (specific can refer to: http://robindotnet.wordpress.com/2011/02/16/ azure-toolssdk-1-3-and-iis-logging/, or you can delete <Sites> nodes completely in "Servicedefinition.csdef", This means that it will no longer run as a full IIS. Now, if you can't resolve the known issues in this SDK 1.3, you can access them directly by browsing their file paths (using development emulator), or you can use Remote Desktop to access logs in the cloud.

If you're curious about the WCF tracking log that you can use immediately, you can open an affiliate project to see how it works for you--you can focus on the "Fixdiagfolderaccess.ps1" PowerShell script. It creates access control tables for this folder and, more importantly, creates a null or completely empty placeholder for the file (we'll rewrite the file eventually).

It can give you a definition of Svclog, which includes all the details of bindings and exceptions. Here you can find "DivideByZeroException" and start diagnosing the problem.

This file will first appear on your hard disk:

A few moments later, the Windows Azure diagnostics system migrates the file to the Wad-tracefiles container of the blob storage.

After that, this log can be downloaded to check for errors. In this example, we can scroll down until we find the details that are 0 apart, and then we'll find a red highlighted line showing an exception. To see more details, we can get the true stack trace of this error from the server.

The source code for this blog post can be downloaded from the following address:

Http://assets.bareweb.eu/wp-content/uploads/2011/03/WCFBasic.zip

Implementing and debugging a WCF service in Windows Azure (top) and implementing and debugging a WCF service in Windows Azure (medium)

Original name: Implementing and Debugging a WCF Service in Windows Azure Author: Andy

"This article is 51CTO selected translations, reproduced please indicate the source!" 】

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.