开发者

SharePoint application page - why try-catch doesn't work?

开发者 https://www.devze.com 2023-02-11 17:36 出处:网络
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

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号