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.
Guess you have references to HttpContext.Current inside your method. That will not work... cause of reasons Magnus explained
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.
Aha, helps to read all the words in the orginal post,, you are right magnus
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).
/Steve
Hi,
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