tags:

views:

194

answers:

1

I have a web service written with Visual Studio 2005. My web.config file contains this:

<system.diagnostics>
    <trace autoflush="true" indentsize="4" />
</system.diagnostics>

But any call to System.Diagnostics.Trace.WriteLine is ignored. When I step through my code, those lines are skipped over.

Is there another way I should be turning on tracing? How can I tell why tracing is turned off?

A: 

I had to add this to my 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" />
  </compilers>
</system.codedom>

I got that from Microsoft's Troubleshooting Web Services article.

Jeremy Stein
So, I guess you were using a Web Site Project? I strongly recommend against using Web Site Projects for web services. Upgrade to VS2005 SP1 and use Web Application Projects instead.
John Saunders