How to debug custom timer jobs in WSS.
This link has been bookmarked by 24 people . It was first bookmarked on 16 May 2008, by Marshall S.
-
18 Mar 11
-
17 Feb 10
-
18 Jan 10
-
The Feature that handles the installation and uninstallation of a timer job should be a hidden Feature so that activation is only possible by using Stsadm.exe through the console. This is because when Features are activated through the Web interface, the application pool's identity is used to execute the code in the Feature receiver
-
-
30 Nov 09
-
19 Nov 09
tresingSPJobLockType.None runs a timer job on all the servers
sharepoint development deployment programming howto configuration schedule timerjobs timerjob
-
11 Mar 09
-
05 Mar 09
-
17 Feb 09
-
20 Oct 08
-
13 Oct 08
-
Add Sticky Note
Debugging Custom Timer Jobs
Inevitably at some phase during the development of an application, you must debug your custom code to isolate and troubleshoot a defect or to monitor the state of the application. Thankfully, you can debug timer jobs by using Visual Studio just as you would any other managed application. However, it is not as easy as pressing F5 or manually attaching to the W3WP.exe process that hosts application pools. Timer jobs are executed by a special Windows service that is set up on the server when you install Windows SharePoint Services: the Windows SharePoint Services Timer. This service triggers the executable Owstimer.exe. You must attach to this process to debug custom timer jobs.
It can be challenging at times to determine whether the application has attached to the process because the jobs may not fire for a few minutes at a time. You could be left with Visual Studio attached to the Owstimer.exe process with breakpoints set, not knowing if the job is running or if the breakpoints are not being hit because of an issue with loading the symbol (*.pdb) files. An easy way to determine whether the timer job is running is to add a single line of code into the SPJobDefinition.Execute method that displays a messagebox on the server and blocks execution of the timer job until you close the message box.
By adding the following code to the Execute method, you not only see your timer jobs running (as shown in Figure 3), but you also have time to manually attach the Visual Studio debugger to the Owstimer.exe process. After attaching the debugger to the process, click Ignore in the message box to enable the timer job to continue to run.
-
-
-
22 Jul 08
-
16 Jul 08
Michael MaurerLearn about building, deploying, and debugging custom timer jobs in Windows SharePoint Services 3.0, and examine the various configuration options that are available to developers.
-
12 Jun 08
-
04 Jun 08
-
23 May 08
-
16 May 08
-
08 May 08
-
06 May 08
Public Stiky Notes
Would you like to comment?
Join Diigo for a free account, or sign in if you are already a member.