views:

50

answers:

1

I've created a simple custom timer job for Sharepoint by using the template i found here: http://saftsack.fs.uni-bayreuth.de/~dun3/archives/visual-studio-2005-project-template-for-sharepoint-2007-timer-jobs/142.html

I've deployed and activated the timerJob successfully. Then I've decided to add a few lines of code to the job to see whether i can test my code.

I've used those commands to uninstall my timerJob:

Stsadm.exe -o deactivatefeature -filename "\WeeklyDigestJob\feature.xml" -url http:/
/vmsrv28:8080/sites/MySite
STSADM -o uninstallfeature -name "WeeklyDigestJob" -force
STSADM -o retractsolution -name WeeklyDigestJob.wsp -immediate
STSADM -o execadmsvcjobs
STSADM -o deletesolution -name WeeklyDigestJob.wsp -override

Then I've checked the folder C:\Windows\assembly, my DLL was not there as i expected. After that I've deleted all the generated binaries (DLLs, the WSP file etc.) from my Visual Studio 2008 project folder and rebuilded the solution. Then i've used the same setup.bat file to install my timerJob and started to wait.

After a minute (schedule was 2 minutes in the previous build, so i see the installer class ran properly as i changed it from 2 to 1 minute) and my timerJob executed. My changes in the execution code didn't show any effect.

My initial code was:

SPListItem newTask = taskList.Items.Add();
string r = DateTime.Now.ToString();
newTask["Title"] = r;
newTask.Update();

Updated Code:

SPListItem newTask = taskList.Items.Add();
string r = DateTime.Now.ToString() + "New DLL";
newTask["Title"] = r;
newTask.Update();

But i didn't get any "New DLL" string in the title of the newly added items.

How can i solve this? Thanks.

+4  A: 

Have you tried restarting the Timer Service in services.msc? I have found in the past this likes to cling onto the dll until you restart it

Also it is worth checking whether a full IISReset as well will help it pick up the DLL

Phill Duffy
Restarting the Timer Service did the trick, thank you very much.
frbry