Debugging a Sitecore application

You might find yourself in a situation where you need to debug your custom code that is placed in a solution outside the web root, but it's getting executed inside the web root. To do this, open your solution in Visual Studio as an administrator. From the Debug menu, click on the Attach to Process menu item. This will open the Attach to Process dialog; check the Show processes from all the users checkbox, find w3wp.exe running with appropriate User Name, for example, NETWORK SERVICE or APPLICATION POOL IDENTITY, whatever you set from IIS Manager, as shown in the following image, and click on the Attach button. Set breakpoints from Visual Studio, where you want to debug your code:

While developing with Sitecore, ...

Get Sitecore Cookbook for Developers now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.