How to enable tracing in ASP Classic Compiler

With the build 0.6.2, we added the option to enable tracing. The tracing can be enabled by setting the following in the global.asax.cs file:

using Dlrsoft.Asp;
AspHandlerConfiguration.Trace = true;

Setting this option will tell the compiler to inject line number into the compiled code. If the compiled code throws any runtime error, the exception will contain the source file name and line number.

If you would like to receive the complete trace history, you will have to configure a trace listener. compiler uses TraceSource “Dlrsoft.VBScript”. The following is an example configuration section in the web.config file:

  <trace autoflush="true">
    <source name="Dlrsoft.VBScript"
    <add name="vbscriptSwitch" value="Verbose"/>

The above configuration will send the trace information to DefaultListener. You can see the trace output using DebugView. You might also route the trace output to ASP.NET tracing using the WebPageTraceListener. Please see this post for more information regarding tracing.

Please note that enable tracing itself only adds a small overhead to the Asp Classic Compiler. However, some listeners can add a huge overhead.


Comments have been disabled for this content.