When a new timer job is created for Sharepoint, it has to be programatically installed in a SPWebApplication.JobDefinitions of type SPJobDefinitionCollection. If the timer job have to receive some settings during run time, one option would be to use the .Net application configuration feature.
First you might think to copy the configuration section from the app.config of the dll where the timer job resides into the web.config of the web application where the timer job is registered. The first catch: the timer job is loaded by the timer service, which is the 'Windows SharePoint Services Timer' Windows service on the web front end servers and runs the "C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\12\BIN\OWSTIMER.EXE" executable, so we have to configure this service.
This can be done by creating the OWSTIMER.EXE.config file near the exe file, and put there the timer job configuration section.
Don't forget to restart the timer service :-).
No comments:
Post a Comment