How to debug custom SharePoint Web Service

%3CLINGO-SUB%20id%3D%22lingo-sub-824038%22%20slang%3D%22en-US%22%3EHow%20to%20debug%20custom%20SharePoint%20Web%20Service%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-824038%22%20slang%3D%22en-US%22%3E%3CP%3EHi%20There%2C%3C%2FP%3E%3CP%3EI%20have%20question%20about%20my%20custom%20Web%20Service%20for%20SharePoint.%20I%20create%20a%20web%20service%20for%20SharePoint%20and%20publish%20it%20into%20the%20layouts%20folder.%20currently%2C%20I%20have%20a%20client%20app%20will%20call%20remote%20the%20web%20service.%20I%20will%20trace%20the%20code%20by%20using%20vs%20.NET%202019.%20when%20my%20code%20call%20remote%20web%20service%20I%20cannot%20go%20into%20the%20source%20code%20of%20the%20remote%20web%20service%20to%20see%20what%20happened.%20before%20I%20just%20change%20the%20web.config%20in%20the%20layouts%20folder%20and%20can%20watch%20the%20difference%20in%20the%20code.%20but%20now%20I%20cannot%20do%20it.%20How%20should%20I%20solve%20it%20out%3F%3F%3C%2FP%3E%3CP%3EIs%20there%20some%20configuration%20missing%20now%3F%3F%3C%2FP%3E%3CP%3EWILL%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-824038%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EDeveloper%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-824058%22%20slang%3D%22en-US%22%3ERe%3A%20How%20to%20debug%20custom%20SharePoint%20Web%20Service%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-824058%22%20slang%3D%22en-US%22%3EBesides%20modifying%20your%20web.config%20you'd%20have%20to%20attach%20your%20debugger%20to%20the%20W3WP%20(IIS)%20worker%20process.%20You%20can%20do%20so%20from%20within%20Visual%20Studio%20--%26gt%3B%20Debug%20--%26gt%3B%20Attach%20to%20process.%3CBR%20%2F%3E%3CBR%20%2F%3EThere%20is%20probably%20more%20than%201%20instance%20of%20this%20process%20running.%20You%20could%20attach%20to%20all%20of%20them%20or%20figure%20out%20the%20correct%20one%20by%20following%20the%20steps%20detailed%20in%20below%20blog%3A%3CBR%20%2F%3E%3CBR%20%2F%3E%3CA%20href%3D%22https%3A%2F%2Fwww.sharepointpals.com%2Fpost%2Fhow-to-identify-and-attach-correct-w3wp-process-in-visual-studio-while-debugging%22%20target%3D%22_blank%22%20rel%3D%22nofollow%20noopener%20noreferrer%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Fwww.sharepointpals.com%2Fpost%2Fhow-to-identify-and-attach-correct-w3wp-process-in-visual-studio-while-debugging%3C%2FA%3E%3CBR%20%2F%3E%3CBR%20%2F%3EHope%20this%20helps%3CBR%20%2F%3E%3CBR%20%2F%3E%3CBR%20%2F%3E%3CBR%20%2F%3E%3CBR%20%2F%3E%3C%2FLINGO-BODY%3E
Highlighted
Frequent Contributor

Hi There,

I have question about my custom Web Service for SharePoint. I create a web service for SharePoint and publish it into the layouts folder. currently, I have a client app will call remote the web service. I will trace the code by using vs .NET 2019. when my code call remote web service I cannot go into the source code of the remote web service to see what happened. before I just change the web.config in the layouts folder and can watch the difference in the code. but now I cannot do it. How should I solve it out??

Is there some configuration missing now??

WILL

1 Reply
Highlighted
Besides modifying your web.config you'd have to attach your debugger to the W3WP (IIS) worker process. You can do so from within Visual Studio --> Debug --> Attach to process.

There is probably more than 1 instance of this process running. You could attach to all of them or figure out the correct one by following the steps detailed in below blog:

https://www.sharepointpals.com/post/how-to-identify-and-attach-correct-w3wp-process-in-visual-studio...

Hope this helps