Search code examples
asp.netiistrace

How to enable tracing for an ASP.NET application?


I follow the description in http://msdn.microsoft.com/en-us/library/0x5wc973(v=vs.140).aspx to enable the tracing of my ASP.NET pages. But it does not work. If I call the trace viewer with http://localhost/MyApp/trace.axd then I receive the error that I should enable the trace flag in the web.config.

  • I have verify that I edit the right web.config with changing "trace" to "trace2". This produce the expected error message.
  • I have reduce the web.config to the max. I use only:
<configuration>
    <system.web>
        <trace enabled="true"/>
    </system.web>
</configuration>
  • I use Windows 8.1 with IIS 8.5.

What can be the cause of the problem?


Solution

  • I have solve the problem. My application was only a virtual directory. Converting it in an application solve the problem. Another solution is to add the trace flag in the root of the IIS.