Home : TWAIN Desktop Scanning : Enable Trace Logging in DotTwain
Q10027 - HOWTO: Enable Trace Logging in DotTwain

DotTwain has tracing code added to it in order to help us debug a problem.  You can enable tracing by adding an Application Configuration File (app.config) to your project.  Then add the following code to create a TraceSwitch named "Atalasoft.Twain".

<configuration>
   
<system.diagnostics>
       
<switches>
           
<add name="Atalasoft.Twain" value="4" />
       
</switches>
       
<trace autoflush="true" indentsize="4">
           
<listeners>
               
<add name="DotTwainListener" type="System.Diagnostics.TextWriterTraceListener" initializeData="c:\DotTwain.log" />
            
</listeners>
        
</trace>
   
</system.diagnostics>
</
configuration>

When you run your project, the DotTwain trace information will be listed in the Output - Debug window within Visual Studio.  The above code also creates a listener that will output the trace information to a log file (c:\DotTwain.log).

You can learn more about tracing from MSDN:  http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vbcon/html/vbconconfigurationoftraceswitches.asp

Related Articles
No Related Articles Available.

Article Attachments
No Attachments Available.

Related External Links
No Related Links Available.
Help us improve this article...
What did you think of this article?

poor 
1
2
3
4
5
6
7
8
9
10

 excellent
Tell us why you rated the content this way. (optional)
 
Approved Comments...
No user comments available for this article.

Powered By InstantKB.NET v1.3
Copyright © 2002, 2017. InstantASP Ltd. All Rights Reserved