.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 application.exe.config file to diagnose problems and performance bottlenecks. 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. You can also insert code in your application to write to the Event Log when problems do occur.

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 user running the application 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.