List Aggregator App (SPFx)

How to debug custom web part and timer job in SharePoint 2013 using Visual Studio

how to debug sharepoint custom application

Learn how to debug custom web part developed using visual studio 2015/2017 and learn how to debug timer job in SharePoint 2013 using visual studio 2017/2015.

As a SharePoint developer, you should know how to debug custom web part in SharePoint 2013 and how to debug timer job in SharePoint 2013 using visual studio 2017/2015.

SharePoint deveopment training course

Debug Custom Web Part in SharePoint 2013 using Visual Studio

Now we will see how we can debug a custom web part in SharePoint 2013.

If you are new to the custom web part development, you can check below tutorials:

Sharepoint custom visual web part execute and debug by the worker process is a windows process (w3wp.exe)

Here are the steps to debug a web part in SharePoint 2013:

Step-1:
Open the project and set the appropriate breakpoints.
Step-2:
Create a Web Part Page on the default SharePoint site.
Step-3:
Add the Web Part to the page.
Step-4:

  • Attach the debugger to the W3wp process.
  • On the Debug menu in Visual Studio .NET, click Processes.
  • Verify that the Show system processes check box is selected.
  • Verify that the Show processes in all sessions check box are selected.
  • Under the available processes, click W3wp.exe in the Process list, and then click Attach.
  • Under Choose the program types that you want to debug, select Common Language Runtime, and then click OK, Then Close

Follow the below steps for finding the application related Work process:
Open CMD -> cd C:\Windows\System32\inetsrv
-> appcmd list wp

sharepoint 2013 debug custom application
sharepoint 2013 debug custom application
how to debug sharepoint custom application
how to debug sharepoint custom application

Debug a Microsoft SharePoint Timer Job with Visual Studio in SharePoint 2013

Now we will see how can we debug timer job in SharePoint 2013 using visual studio. You can read: Steps to create a custom timer job in SharePoint 2016 using Visual Studio 2015.

SharePoint timer jobs are tasks executed on a scheduled basis by the Windows SharePoint Services timer service (owstimer.exe). They are analogous to scheduled tasks,

1. First, deploy your solution containing your timer job to SharePoint. From Visual Studio click Build and then Deploy Solution.

debug custom application sharepoint 2016.png
debug custom application sharepoint 2016.png

2. Open Windows Services. Click the Start button and type Services, alternatively, this can be accessed from Control Panel > System and Security > Administrative Tools.

3. Select the service named SharePoint Timer Services this ensures the latest .DLL is loaded for your timer job.

debug custom application in sharepoint 2013
debug custom application in sharepoint 2013

4. From Visual Studio attach the debugger to the process named OWSTIMER.EXE. To do so select Debug and Attach to Process. You may need to tick the check box Show processes from all users to find OWSTIMER.EXE.

sharepoint online debug custom application.png
sharepoint online debug custom application.png

Hope this will be helpful to debug custom web part and timer job in SharePoint 2013 using Visual Studio.

Check out Best Alternative to InfoPath -> Try Now

free sharepoint training

SharePoint Online FREE Training

JOIN a FREE SharePoint Video Course (3 Part Video Series)

envelope
envelope

About Sagar Pardeshi

I am Developer working on Microsoft Technologies for the past 6+years. I am very much passionate about programming and my core skills are SharePoint, ASP.NET & C#,Jquery,Javascript,REST. I am running this blog to share my experience & learning with the community I am an MCP, MCTS .NET & Sharepoint 2010, MCPD Sharepoint 2010, and MCSD HTML 5,Sharepoint 2013 Core Solutions. I am currently working on Sharepoint 2010, MOSS 2007, Sharepoint 2013,Sharepoint 2013 App Dev, C#, ASP.NET, and SQL Server 2008.

View all posts by Sagar Pardeshi →