Vulnerability in EPiServer.Forms

Try our conversational search powered by Generative AI!

Scheduled task errors when run automaticaly



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


Oct 23, 2009 22:15

Maybe you have a issue where the user that runs the job does not have the correct permissions?

Have a look at this:

Oct 26, 2009 14:13

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";

Edited, Oct 26, 2009 14:31

Check here for some other tips&tricks:

One thing could be that another dev computer is running the job before your computer does.

Oct 26, 2009 15:09

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.

Oct 26, 2009 15:33

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.


Oct 26, 2009 16:49
This thread is locked and should be used for reference only. Please use the Episerver CMS 7 and earlier versions forum to open new discussions.
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.