I have created a custom timer job. I deploy it with a feature that has a WebApplication scope. The Execute() method in my job definition class keeps throwing errors. I'm trying to get a reference to the Web Application in the Execute method, but nothing seems to work. I've tried several methods of getting this reference:

SPWebApplication webapp = this.WebApplication;


SPWebApplication webapp = this.Parent as SPWebApplication;

both of these are returning null.

Any clues what the issue could be?

1 Answer 1


Resetting the Sharepoint Timer Service fixed my issue:

Start>Control Panel>Administrative Tools>Services>SharePoint 2010 Timer

ref: https://sharepoint.stackexchange.com/a/22466/17398

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.