In this article explore for Beginner level SharePoint developer how to debug SharePoint custom application standards ways to debug.
Debug a Microsoft SharePoint Custom Web part with Visual Studio:
Sharepoint custom visual web part execute and debug by the worker process is a windows process (w3wp.exe)
Here is the steps to debug a web part in SharePoint:
open the project and set the appropriate breakpoints.
Create a Web Part Page on the default SharePoint site.
Add the Web Part to the page.
– 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 is selected.
– Under 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
Read some SharePoint jsom tutorials:
- Steps to delete attachments of SharePoint list item using REST API in SharePoint 2013
- Display SharePoint list item level attachments using REST API and JQuery in SharePoint 2013
Follow the below steps for finding the application related Work process:
Open CMD -> cd C:\Windows\System32\inetsrv
-> appcmd list wp
Debug a Microsoft SharePoint Timer Job with Visual Studio:
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.
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.
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.
Hope this will be helpful.