My team and I are working on a .net web app project for the first time. We want to know the most effective way to debug issues on a production server. Currently, we ftp upload our work to a client’s production server.
Since our background is in LAMP, we’re using to SSHing into the production server, and using a combination of die(), print_r() and comment out techniques to troubleshoot the problem.
Unless I misunderstand the way .net work, I don’t think i can use the same approach because changes to .net code behind requires a complete re-build of the project (on localhost), then an upload. This is too time consuming….
Is there a better way to troubleshoot issues on a production server?
There are really only three ways to debug server side issues.
Logging
Plan ahead and add logging to your application. Most logging frameworks like log4net and Enterprise library have modes to log more or less information depending on a configuration setting. IIS also has its own logging that you can look at.
Instrumentation
You can add performance counters to your application and also use the existing performance counters if you are having a performance issue. Also tools available from Sysinternals and WireShark can come in handy for problems outside of your code.
Memory Dumps
You can capture memory dumps of your application and use a tool like WinDbg to look at a snapshot of what’s going on in your system.