您的位置:首页 > 移动开发 > Objective-C

Sharepoint timer job:Object reference not set to an instance of an object

2012-05-02 16:19 513 查看
When created a custom timer job in sharepoint 2010. I receive the famous "Object reference not set to an instance of an object" error on the very first line of the Execute() method.

Using(SPsite site = spcontext.current.site.ID)

{

using(spweb web = site.openweb()

}

When a timer job runs there is no SPContext.Current. You can try using this.WebApplication to obtain the current web application that the timer job is running against.
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐