.netCoders Contact Us
Search:

Diagnostics

There are several ways to diagnose and resolve errors and issues in a web application. If you can replicate the error in development, try stepping through the code using the Visual Studio Debugger. Here are some tips for maintaining and supporting a production application.

Implement Tracing

If you implement tracing in your code, you can enable switches in the web.config file to diagnose problems and performance bottlenecks. You can also enable tracing for individual ASP.NET pages or for the web application as a whole. For more information about implementing tracing in your code, see our section on Tracing.

Check the Event Log

When things look to be going awry, check the Windows Event Log to see if any messages have been entered.

Isolate the Problem

Remember not all bugs are in the code. Try and replicate the problem on another machine with the same codebase. If you can replicate the problem on a development machine, recompile the application in debug mode to see if you can obtain more information about the problem.

Verify Security and Permissions

In many cases, errors come down to a security or permissions issue. For example, the IUSR_ account may not have rights to a certain directory. Monitor security events in Windows if you cannot immediately see a problem but sense it is security related.