R
rehto
We have an ASP.NET 2.0 (C#) app and we want to enable tracing (see the code
snippets below).
The first time a user navigates to the app., the tracing works fine (the
ASP.NET tracing appears on the screen and writes to a text file). The
problem happens any subsequent time the app. is used--tracing doesn't
happen. It's as if tracing just turns itself off. So, we only get tracing
on the first time the app runs but never any other time.
Has anyone ever seen this?
What could we be doing wrong?
Any suggestions on how to fix?
Web.config
<system.web>
...
<trace enabled="true" pageOutput="true" writeToDiagnosticsTrace="true"/>
</system.web>
<system.diagnostics>
<trace autoflush="true" indentsize="4">
<listeners>
<add name="WebPageTraceListener" type="System.Web.WebPageTraceListener,
System.Web, Version=2.0.3600.0, Culture=neutral,
PublicKeyToken=b03f5f7f11d50a3a"/>
<add name="TextWriterTraceListener"
type="System.Diagnostics.TextWriterTraceListener"
initializeData="D:\Temp\TraceFiles\Application_TraceFile.log"/>
</listeners>
</trace>
</system.diagnostics>
Default.aspx (no UI/no HTML, only code-behind)
protected void Page_Load(object sender, EventArgs e)
{
// Do some stuff
Trace.Write("category", "message");
Response.Redirect("Next.aspx", true);
}
Next.aspx (no UI/no HTML, only code-behind)
protected void Page_Load(object sender, EventArgs e)
{
// Do some stuff
Trace.Write("category", "message");
Response.Redirect("TheRealStartPage.aspx", true);
}
TheRealStartPage.aspx (this page has HTML and code-behind)
protected void Page_Load(object sender, EventArgs e)
{
// Do some stuff
Trace.Write("category", "message");
}
snippets below).
The first time a user navigates to the app., the tracing works fine (the
ASP.NET tracing appears on the screen and writes to a text file). The
problem happens any subsequent time the app. is used--tracing doesn't
happen. It's as if tracing just turns itself off. So, we only get tracing
on the first time the app runs but never any other time.
Has anyone ever seen this?
What could we be doing wrong?
Any suggestions on how to fix?
Web.config
<system.web>
...
<trace enabled="true" pageOutput="true" writeToDiagnosticsTrace="true"/>
</system.web>
<system.diagnostics>
<trace autoflush="true" indentsize="4">
<listeners>
<add name="WebPageTraceListener" type="System.Web.WebPageTraceListener,
System.Web, Version=2.0.3600.0, Culture=neutral,
PublicKeyToken=b03f5f7f11d50a3a"/>
<add name="TextWriterTraceListener"
type="System.Diagnostics.TextWriterTraceListener"
initializeData="D:\Temp\TraceFiles\Application_TraceFile.log"/>
</listeners>
</trace>
</system.diagnostics>
Default.aspx (no UI/no HTML, only code-behind)
protected void Page_Load(object sender, EventArgs e)
{
// Do some stuff
Trace.Write("category", "message");
Response.Redirect("Next.aspx", true);
}
Next.aspx (no UI/no HTML, only code-behind)
protected void Page_Load(object sender, EventArgs e)
{
// Do some stuff
Trace.Write("category", "message");
Response.Redirect("TheRealStartPage.aspx", true);
}
TheRealStartPage.aspx (this page has HTML and code-behind)
protected void Page_Load(object sender, EventArgs e)
{
// Do some stuff
Trace.Write("category", "message");
}