Deploying Timer Jobs

So I’m working on a Timer Job for SharePoint at the moment, I found that the post that Andrew Connell has made describing the development process is very good, read it here: http://www.andrewconnell.com/blog/articles/CreatingCustomSharePointTimerJobs.aspx

Anyway I was trying to debug my job by attaching to the OWSTIMER process and it appeared that the process was running an old version of my code. 😐 It appears that to ensure that the newly deployed version of the DLL that you have deployed to the GAC you need to restart the OWSTIMER process.

So  I’ve included that into my script to deploy and everything is happy again. Below is a sample deployment script for your reference.

net stop sptimerv3
rd /s /q "%CommonProgramFiles%\Microsoft Shared\web server extensions\12\TEMPLATE\FEATURES\MyTimerJob"
mkdir "%CommonProgramFiles%\Microsoft Shared\web server extensions\12\TEMPLATE\FEATURES\MyTimerJob"
copy /Y feature.xml "%CommonProgramFiles%\Microsoft Shared\web server extensions\12\TEMPLATE\FEATURES\MyTimerJob\"
gacutil /u MyTimerJob
gacutil /i bin\debug\MyTimerJob.dll
pushd %programfiles%\common files\microsoft shared\web server extensions\12\bin
stsadm -o deactivatefeature -filename MyTimerJob\feature.xml -url http://col/ -force
stsadm -o uninstallfeature -filename MyTimerJob\feature.xml -force
stsadm -o installfeature -filename MyTimerJob\feature.xml -force
stsadm -o activatefeature -filename MyTimerJob\feature.xml -url http://col/ -force
popd
net start sptimerv3

Advertisement
This entry was posted in Deployment, SharePoint. Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.