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 creating a job but it doesn't seem to be executing.

The constructor is being called, but the OnExecute isn't, I can tell that since I see it in DbgView: [6960] ReadAuditLogJob() [6960] ReadAuditLogJob(ReadAuditLog) [6960] ReadAuditLogJob() [6960] ReadAuditLogJob() [6960] ReadAuditLogJob()

Here's the code: public class ReadAuditLogJob : SPJobDefinition { public ReadAuditLogJob() : base() { Trace.WriteLine("ReadAuditLogJob()"); }

    public ReadAuditLogJob(SPWebApplication webApp) : base(SPSureConfiguration.JobName, webApp, null, SPJobLockType.Job)
    {
        this.Title = SPSureConfiguration.JobName;
        Trace.WriteLine(string.Format("ReadAuditLogJob({0})", Title));
    }

    public override void Execute(Guid targetInstanceId)
    {
        Trace.WriteLine("ReadAuditLogJob::OnExecute");
    }

}

Any ideas? Thanks!

share|improve this question

2 Answers 2

up vote 1 down vote accepted

You can try to reset "Windows Sharepoint Timer" service.

share|improve this answer
    
Thanks all. I figured it out. It appears that you have to use the 'deploy' in visual studio 2010 and then kill the OWSTimer.exe task. I suppose bouncing SPTimerV4 would have done the trick too...just like you said. –  user2062 Dec 28 '10 at 14:06

How are you creating the Timer Job?

If you're not calling Update() then the job won't get saved, and will never run.

Assuming that's not the problem, the other thing to make sure is that you're attaching to the right process, you should be attaching to OWSTimer.exe, if you're attaching to w3wp.exe you'll get Constructor trace when you visit the monitoring pages, but never the Execute.

share|improve this answer

Your Answer

 
discard

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