Welcome Guest! To enable all features please Login or Register.

Notification

Icon
Error

debug="false" and Application_Error
jeongkyueum
#1 Posted : Thursday, February 1, 2007 6:29:40 PM(UTC)
Groups: Member
Joined: 2/1/2007(UTC)
Posts: 3

Hi
I have implemented a application wide error logging system for my ASP.NET application.
It works fine when debug is set to "true" in the web.config file, but there seems to be a problem if debug is set to "false".

For now, my Application_Error method in global.asax looks like the following:

void Application_Error(object sender, EventArgs e)
{
Response.Write(HttpContext.Current.IsDebuggingEnabled);
Response.End();
}

And I have a test.aspx in which I throw new Exception("test") always.

If debug="true", What I see when I try browsing test.aspx is

True

which is correct behaviour, but when debug="false",

I get the normal exception page titled "test" saying that I have to turn debug to "true" if more information is needed about the exception.

It obviously looks like it's not going through Application_Error method when debug="false".


Am I doing something wrong? or is there possibly a bug?

Im using the .NET framework 2.0 and UltiDev for ASP.NET 2.0.
Ultidev Team
#2 Posted : Friday, February 2, 2007 5:42:40 AM(UTC)
Ultidev Team

Groups: Administration
Joined: 11/3/2005(UTC)
Posts: 2,253

Thanks: 28 times
Was thanked: 60 time(s) in 59 post(s)
Hi,

We would recommend trying a couple of things:
- Try replacing "Response.Write(HttpContext.Current.IsDebuggingEnabled);" with "Response.Write(HttpContext.Current.IsDebuggingEnabled.ToString());" in the Application_Error();
- To see detailed exception information please make sure you access your page using htpp://localhost or http://127.0.0.1. Alternatively change the value of <customErrors> section in the web.config to allow remote users see exception information;
- Finally, try the same scenario with IIS - we would like to be sure the issue is caused by UltiDev Cassini before we go deeper into troubleshooting.

Best regards,
UltiDev Team.
Please donate at http://www.ultidev.com/products/Donate.aspx to help us improve our products.
jeongkyueum
#4 Posted : Tuesday, February 13, 2007 10:26:56 AM(UTC)
Groups: Member
Joined: 2/1/2007(UTC)
Posts: 3

I have confirmed that the Application_Error method is called when debug="false" in IIS5.1 (Windows XP Pro SP2)
I used the following code in Application_Error method.
StreamWriter writer = File.CreateText(Server.MapPath("/") + "\\test.txt");
writer.Write("ERROR");
writer.Close();

Ultidev Team
#5 Posted : Tuesday, February 13, 2007 10:37:45 AM(UTC)
Ultidev Team

Groups: Administration
Joined: 11/3/2005(UTC)
Posts: 2,253

Thanks: 28 times
Was thanked: 60 time(s) in 59 post(s)
Hi,

Since you have established that Application_Error() is called with Debug="False" we assume this issue can be closed.

Please let us know if you need any further help.

Best regards,
UltiDev Team.
Please donate at http://www.ultidev.com/products/Donate.aspx to help us improve our products.
Guest
#6 Posted : Saturday, September 15, 2018 7:46:52 PM(UTC)
Groups:

Message was deleted by a Moderator.
Rss Feed  Atom Feed
Users browsing this topic
Guest (7)
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You can vote in polls in this forum.