SaaS CMS has officially launched! Learn more now.

Scheduled Job Problem



First we have created scheduled locally..i am able to run it manually and automatically.Then we moved the code to integration.There i am getting Exception as "Exception has been thrown by the target of an invocation. [Sitemap Creation error at Execute() for SitemapScheduler for Sweden site]".Manul job is working fine..only when job runs automatically i am getting above error.

What access levels we have to set for scheduled job.We are using CMS5


Jan 31, 2011 13:40

The scheduled job is by default run as an anonymous user, while it will run in your current user's context when you trigger it manually. Also your exception message seems to be a custom one so that should give you clues where in your code to look.

Jan 31, 2011 13:52

Guess you have references to HttpContext.Current inside your method. That will not work... cause of reasons Magnus explained

Jan 31, 2011 14:26

But then it should fail when running scheduled in the local environment as well. But with the anonymous vs permissions problem there could be a difference in access rights between the two environments.

Jan 31, 2011 14:28

Aha, helps to read all the words in the orginal post,, you are right magnus

Jan 31, 2011 14:29

Is the scheduled task writing to disk? You need to give IIS_IUSRS write access to the directory you're writing the sitemap too (if this is the case).


Jan 31, 2011 16:49
* 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.