How to output debug information of Windows Phone to the output window of Visual Studio

Source: Internet
Author: User

It is very simple to output debug information on Windows Mobile. You can directly use console. writeline, but this method is not available on Windows Phone. It is actually very simple, that is, a sentence.

System. diagnostics.Debug. Writeline ("Debug message");

 

The procedure is very simple, and the release version automatically shields the information, which is very practical.ProgramThis method has also been used in the lifecycle video. The following describes why this function is required.

Based on your own experience, there are two reasons:

1. when mvvm is used, events are converted to pre-defined commands. These commands bind Delegate to the XAML during data binding. Therefore, debugging is not allowed during running (the debug version is acceptable ). In fact, this is not the main reason, or the root cause, because one of the characteristics of mvvm is testable (testability), I love TDD very much (unit test-driven development ), more logic should be determined through unit testing instead of printing debug information.

2. When I was dealing with tombstone, now I am developing a Windows Phone 7 program and spend a lot of time on tombstone processing. I think "Tombstone processing" has becomeAvailable programsWithEasy to useImportant differences. So far, I think unit testing tombstone is still very difficult, so Debug. writeline () is my choice.

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.