I am creating Timer Job in Sharepoint 2010. When I try to deploy the solution I get the following error :

Error occurred in deployment step 'Add Solution': Object reference not set to an instance of an object.

I am not able to figure out the cause of this error. Please help me. Thanks in advance.

5 Answers 5


As you wrote, the error occurs in the adding your solution. Are you trying to install a new timer job from your job definition in the feature event receiver?

If so, you could try the powershell way Remove the timer job installation code from your solution, but leave the job definition code.

Then in Powershell try to run this powershell code line for line and see what errors occur there:

$app = get-spwebapplication http://intranet
$name = "you-name-it-timer"
$job = new-object your.solution.namespace.MyTimerDefinition($name, $app)
$job.Schedule = [Microsoft.SharePoint.SPSchedule]::FromString("Every 15 minutes between 0 and 59")
#must restart timer service
restart-service sptimerv4

Right click Visual Studio-> Run as administartor


Try to implement the same same source code in a webpart and then debug to find the issue...


Can you try debugging the solution?

Add a using System.Diagnostics class in your timer job class and add a Debugger.break() statement in your code where you need to debug.

Deploy the timer job solution to the farm again. Restart the SharePoint Timer service, IIS Reset and when you run the timer job, there will be a debugger window poping up to select your visual studio solution. Select your solution and within few seconds, it will start debugging.

Good Luck.


What is the solution scope is it Web?, if it is it will throw you this error. Set the Scope to Site. And if this is not the case, most probably its the permission issue. Refer to this link. Hope this helps

  • the scope it Web Application. I have checked the permissions and they seem alright. Mar 22, 2012 at 8:30
  • For this kind of project you need to set the scope to Site. Please refer to this website dotnetfinder.wordpress.com/2010/07/24/… Mar 22, 2012 at 10:11
  • thx a lot all of u for ur responses.... :)) Mar 22, 2012 at 11:53
  • Web Application scope should be fine; that's what I always use.
    – Andy Burns
    Mar 22, 2012 at 12:13

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.