Sync Service for ADO. NET program debugging (II.)

Source: Internet
Author: User

Use tracing to generate log (data synchronization logs) [device]

The principle of debugging on the device and desktop the same, but the relevant configuration files are different, the first time read this article friends, please refer to the "desktop article"

The principle of using tracing and desktop is the same on device, only slightly different configuration methods.

Because the wince Sync Service for Ado.net does not publicly declare support for tracing production log, configuring in App.config is ineffective and the correct configuration method is as follows:

On the wince platform, create a new configuration file named: Trace.config.txt

Put this file into the directory of your EXE program (very IMPORTANT!) )

Then add the following to the configuration file:

<? xml version="1.0" encoding="utf-8" ?>
<configuration>
<traceSettings>
<add key ="FileLocation" value="test.txt"/>
<add key ="LogLevel" value="4"/>
</traceSettings>
</configuration>

After the program is run, the tracing Log is generated.

2 points to note:

Make sure your trace.config.txt and your EXE program are in the same directory, otherwise log will not be generated. An empirical approach is to add trace.config.txt to your vs soltuion so that when deployment, Trace.config.txt will automatically deploy to device.

If you do not specify a path to the log file, the default is to put it in the device directory (root).

Related information:

Http://msdn.microsoft.com/en-us/library/cc807160.aspx

Source: http://liangyiming.cnblogs.com

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.