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.
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.
相关文章推荐
- VS2010 出现错误提示“Error Creating Control - Object reference not set to an instance of an objec” 的解决方法
- TFS 客户端错误"Object reference not set to an instance of an object."
- WebAdaptor Object reference not set to an instance of an object.
- 奇怪的 Object reference not set to an instance of an object
- NET:Error Creating Control -"Object Reference Not Set To An Instance Of Object"
- vs2015 新建项目时提示Object reference not set to an instance of an object该怎么解决呢
- ASP.NET MVC Html.TextBox 报 Object reference not set to an instance of an object 的解决方案
- Object reference not set to an instance of an object
- [BTS]Object reference not set to an instance of an object
- unity3D报NullReferenceException: Object reference not set to an instance of an object
- Object reference not set to an instance of an object
- silverlight安装后仍然提示安装以及打开vs的xaml页面提示Object reference not set to an instance of an object 错误
- silverlight项目出现object reference not set to an instance of an object的解决办法
- Build (web): Object reference not set to an instance of an object
- 20100507 学习记录: Server Error in '/' Application. Object reference not set to an instance of an object
- 解决调用context.Session["NAME"]时总出现Object reference not set to an instance of an object.异常的方法
- 关于Unity3D的错误:NullReferenceException: Object reference not set to an instance of an object 的解答
- VB.NET Error Object reference not set to an instance of an object
- “Object reference not set to an instance of an object. ”错误
- silverlight beta2.0安装成功后新建silverlight项目出现object reference not set to an instance of an object的解决办法