We have an ASP.NET application using VB.NET (VS 2005) and the .NET 2.0 Framework. All servers are IIS 6 on Windows 2003 Server. When we run in our development environment, everything runs as expected. Everything runs fine in our testing environment. Once in production, errors ocurr periodically, maybe once a week and continue to affect most users for an average of 10 minutes. We are able to log these errors, and we're logging line numbers from the error messages. This at first made me think debug was set to true, but after double checking the web.config file, I find that it is set to false. I cannot make this happen in development by turning debug to false and does not happen in the test environment either. We had our IT department setup another server (clean build, no restores) like production in case something was wrong with it and we get the same behavior with line numbers in error message if we make the code break.
What is different from our development and testing environments from production is that production is located in a blade center on virtual servers. Any thoughts on the debug behavior? The only way I can get without line numbers is by removing the PDB files, but I'm not sure if it is still running in debug mode.
Aside from the debug mode I feel running in debug could be presenting some problems with items stored in session which ultimately cause other errors. I've noticed errors while stepping through code in debug and pausing to answer the phone and objects are gone from memory when I return. In production it seems that the occasional errors are happening from this same sort of thing. Our code goes a little like this, on one line an object is grabbed from session or database, if an error is caught or if object is nothing then we recreate it. If an error happens there, it exits gracefully and records the error. But if it creates successfully, it continues on. Our code continues on then errors when comparing the value stating the object doesn't exist. We got this from the line numbers being recorded. Any other error or scenario for the object not being there would result in code moving to a different line. These errors aren't limited to one or just a couple of code areas, but happen throughout the codebase. So its like we query the database, check if dataset is valid, has table(s) and record(s) then error when getting a row.
I've even tried to override this by editing the machine.config with <deployment retail="true"/> but no change.