Maybe you have a issue where the user that runs the job does not have the correct permissions?
Have a look at this: http://labs.episerver.com/en/Blogs/Ted-Nyberg/Dates/112276/8/Run-a-scheduled-job-as-a-specific-EPiServer-user/
I have tried that with no joy. My current code is:
[EPiServer.PlugIn.ScheduledPlugIn(DisplayName = "Reel Content Service")]
public class ReelContentTask
{
static ReelContentTask()
{
if (PrincipalInfo.CurrentPrincipal.Identity.Name == string.Empty)
{
PrincipalInfo.CurrentPrincipal = PrincipalInfo.CreatePrincipal("Admin");
}
}
public static string Execute()
{
return "test";
}
}
Check here for some other tips&tricks: http://antecknat.se/blog/2009/03/04/scheduled-tasks-tips/
One thing could be that another dev computer is running the job before your computer does.
Thats it. Man, I've been pulling my hair out over this. We have a shared dev database and one of the developers had his clock set faster than mine so his was trying to execute the task. The annoying thing is, i'd been to that page and followed the steps for the "Object reference to set to an instance of an object" issue. Moral of the story, read the whole article.
Thanks again.
I vote for a new field in the scheduled task status logs: "Machine Name" where the job has been run. I've been bitten by this problem too many times to count.
/Steve
Hi,
I have created a scheduled task to parse and XML file and setup some pages from it. This all worked fine when run manualy, however when I aurtomate it, it fails with "Object reference not set to an instance of an object". I'm not sure how to debug this, but as a test I removed all functionality from the Execute method and just returned a string "test" and this fails in the same way when triggered automaticaly.
Does anybody have any idea what the issue might be? and how I could debug it?
Many thanks
Matt