How to debug a SharePoint timer job with Visual Studio

SharePoint Server Jun 28, 2021

Timer jobs are an effective solution to handle a situation where a specific process needs to run periodically. The following steps describe how to debug a Microsoft SharePoint 2010 timer job using Visual Studio.

1. Deploy your solution containing your timer job to SharePoint by clicking Build and then Deploy Solution

2. Open the Control Panel. Click System and Security, click Administrative Tools and then open Windows Services.

3. Select the service named SharePoint 2010 Timer and ensures that it’s running.

4. From Visual Studio, select Debug and Attach to Process and attach the debugger to the process named OWSTIMER.EXE. N.B In case you don’t see that process, tick the checkbox Show processes from all users.

5. Open the Central Administration. Click on Monitoring and then select Review job definitions to see a list of all time jobs.

6. Select your timer job and click Run Now

Your timer job will now execute and will hit any breakpoints you have set within Visual Studio.

Tags

Great! You've successfully subscribed.
Great! Next, complete checkout for full access.
Welcome back! You've successfully signed in.
Success! Your account is fully activated, you now have access to all content.