Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

I'm busy writing / debugging my first custom timer job in Sharepoint 2010.

What is working so far:

  1. The timer job installs
  2. The timer job can start

What's not working:

  1. Nothing else seems to be working. It just runs indefinitely without any results or progress.

My execute method so far:

public override void Execute(Guid contentDbId)
        {
            this.UpdateProgress(1); 
            Tasks.TaskMan taskMan = new Tasks.TaskMan();
            taskMan.RunInsertTasks();
            this.UpdateProgress(33); 
        }

Task man task should take about 5 minutes to complete. Basically what it will do is insert items to a list and to a taxonomy term store. The code tested in a console application works.

What could the problem be, I've followed the sample code on timer jobs down to the last letter, checked and rechecked, but it seems the job just isn't working for some reason.

Thanks in advance

Update

Changed my method to now be:

public override void Execute(Guid contentDbId)
            {
                this.UpdateProgress(1); 
            }

Same problem , seems to run indefinitely.

share|improve this question
add comment

2 Answers

up vote 0 down vote accepted

Possibly to do with user permissions under which your TaskMan task operates?

Your console app would run under the rights of you logged in, whereas the timer job runs under whatever OWSTIMER operates.

Something permissions related could be causing your TaskMan task to halt for some reason.

share|improve this answer
    
@James, check update, surely this new Execute method shouldn't require any advanced permissions? –  user879 Jan 11 '11 at 21:38
    
Does it stick on 1%, by any chance? –  James Love Jan 11 '11 at 21:51
    
Ok thanks you were right , applied to permissions. But I needed to restart the timer service manually to get real debugging. otherwise it seemed to execute old code for some reason. –  user879 Jan 11 '11 at 22:17
    
correct, this reason is called the GAC :) –  Jaap Vossers Jan 12 '11 at 15:36
add comment
  1. Attach debugger to owstimer.exe
  2. step into UpdateProgress, step, step, step
  3. find bug
share|improve this answer
    
+1 for attaching debugger to the owstimer.exe ;) –  Falak Mahmood Jan 12 '11 at 11:49
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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