- On Visual studio go to Dynamics 365 > Options > Debugging
- On Visual studio go to Debug > Options > Debugging > Symbols
- Set your project as startup project by right clicking on project and selecting 'Set as StartUp Project'
- Set the element which you want to debug as startup object by right clicking on element and selecting 'Set as StartUp Object'
- Set a breakpoint in first line of code snippet which you want to debug.
- You now have two options:
- Start the project directly from Visual Studio by clicking on 'Start' button on Action pane or use shortcut F5. It will build the project and run on a new browser instance.
- Build your project (shortcut Alt+b,u)
- On internet explorer login to your environment, in case if already logged in refresh the tab.
- Attach 'w3wp.exe' process by clicking on Debug > Attach to process... (or use shortcut ctrl+alt+p). On the opened form check the 'Show processed from all users' and select 'w3wp.exe' from the list and click Attach button. It will attach services need for debugging.
Your breakpoint will hit once you run your target form/class/report. :)