I asked a question about this a few months back, and it ended up off on a tangent. However, I'm having the problem again, and I need to get this resolved.
I have a web app (C#, and ASP.Net 2.0 developed using Visual Studio 2005), and in the Global.asax Session_Start event, I am calling a number of methods from a Class Library my unit developed to populate Session variables that are used throughout the app. The app physically resides on a web server, so after compiling/building the site, we access it using IE and the virtual directory that's set up using IIS.
Here's where it gets frustrating. After building the site and trying to access it, I get an error message thrown from Default.aspx's code-behind, in essence saying that a Session variable I populated in Global.asax is null (that's my translation of the error code put in context). So wondering if I messed it up somehow, I put a Debug breakpoint in the Session_Start method in Global.asax and stepped through the whole method, only to see it work perfectly, and the IE window it brought up while debugging displays the page just like it should. But if I just put the virtual address in IE and try to access it normally, I still get the error.
So why can I get the page to work in Debug mode, but not normally?