The principle of debugging on Device and Desktop is the same, but the configuration file is different, the first time to read this article of friends, please refer to [Desktop]: http://www.cnblogs.com/liangyiming/archive/2009/04/01/1427388.html
Tracing works the same as Desktop on Device, but the configuration method is slightly different.
Because the Sync Service for ADO. NET Based on WinCE does not publicly declare that it supports Tracing production logs, configuration in App. config is ineffective. The correct configuration method is as follows:
- On the WinCE platform, create a configuration file named trace.config.txt.
- Put this file in the directory of your EXE program (very important !)
- Then add the following content 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.
Note the following two points:
- Make sure that your trace.config.txt and your EXE program are in the same directory, otherwise logs will not be generated. An empirical method is to add trace.config.txt to your VS soltuion. in this case, trace.config.txt will automatically Deploy to the Device when deployment.
- If you do not specify the path of the Log file, it is put into the ROOT directory of the Device by default.
Related information:
- Http://msdn.microsoft.com/en-us/library/cc807160.aspx
Author: Liang yiming
Source: http://liangyiming.cnblogs.com
The copyright of this article is owned by the author. You are welcome to repost this article. However, you must keep this statement without the author's consent, and provide the author's name and original text link clearly on the article page. Otherwise, you will be held legally liable.