Thursday 19 July 2007

Sharepoint Development Tips 5- Customize MOSS TimerJob

No intention to steal the posts from other people here since Andrew Connell has posted a very nice and detailed article on his blog introducing how to create custom timer job on MOSS. He is kind enough to post his sample project as well.


In his article , he packaged the dll using solution file(*.wsp), here I just introduce how to deploy it using a simple feature if you don't want to add the whole deal with other dlls.

The only difference, as you might already find out, is the xml files. So for the feature.xml, it will be as following

and please note that the "Hidden" value is set to "True", for the UI user can use to turn on/off in sharepoint is using the application pool account to access the content DB, which will be permission denied if you don't grant your account to the DB. So it will fail when you activate the feature.
And the manifest file elements.xml is as following
Note that you have to specify a listtemplateid here, even though you don't want to bind it to any list or doc library.

At last, you should be cautious when changing the code and update the assembly. Sometimes even if you updated the GAC and did a iisreset, it still won't pick up the new one. You have to restart Windows! See my other post regarding this same problem with SPD workflow!

No comments: