SharePoint application page - why try-catch doesn't work?
My application page doesn't work correctly. In error log I could find this:
Detected use of SPRequest for previously closed SPWeb object. Please close SPWeb objects when you are done with all objects obtained from them, but not before.
In my application page in code behind I have all snippets of code in try-catch blocks. The question is why when such situation(described in log) appears the control doesn't go to catch st开发者_运维百科atment? Instead of that the internal SharePoint error appears on screen.
Regards
The reason it is not going to your catch block is because the message being logged is just a warning, it doesn't interrupt the execution of your code.
Use SPDisposeCheck to pinpoint the origin of the message.
精彩评论