Login
 

    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

preload preload preload