VB ASP Trace Outputed to File

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I've got a web service running, and i'm trying to build tracing into it that
is outputted to a file. Unfortunately, i can't find a way of enabling TRACE
token, and it just seems to skip over all System.Diagnostics.Trace lines in
the debugger.
I don't want to use the ASP page trace dump, as it will break my SOAP
interface.

This code is called on my application start event:


Dim lstrFileStream As System.IO.FileStream
Dim objTraceListener As System.Diagnostics.TraceListener

'Create Stream and Listener
lstrFileStream = New System.IO.FileStream("C:\Temp\Tracer.Log",
IO.FileMode.OpenOrCreate)
objTraceListener = New
System.Diagnostics.TextWriterTraceListener(lstrFileStream)
objTraceListener.TraceOutputOptions = Diagnostics.TraceOptions.Timestamp

'Trace Item
System.Diagnostics.Trace.Listeners.Add(objTraceListener)



This is called at the start of one of the SOAP requests:


System.Diagnostics.Trace.Write("Add Account Called.")
System.Diagnostics.Trace.Flush()


This generates an empty file, and never writes anything too it.

While i am aware that this style of trace listener may not be ideal, i'd be
happy with it writing anything right now.

Any thoughts?

Cheers Chaps

Tris
 
you may need this in your web.config

<system.codedom>
<compilers>
<compiler language="c#;cs;csharp" extension=".cs"
compilerOptions="/d:TRACE" type="Microsoft.CSharp.CSharpCodeProvider, System,
Version=2.0.3500.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"
warningLevel="1"/>
<compiler language="VB" extension=".vb"
compilerOptions="/d:Trace=true" type="Microsoft.VisualBasic.VBCodeProvider,
System, Version=1.0.5000.0,
Culture=neutral, PublicKeyToken=b77a5c561934e089"/>
</compilers>
</system.codedom>


HTHs
 
Back
Top