DotNet Debugging
Disable Release build optimization
This is done for better debugging experience
-
In DnSpy click on
Edit Assembly Attributes (C#)
, Now find -
Replace with
-
Recompile the module
- Save the module
- Restart IIS
Debug IIS
- To make sure
w3wp.exe
is running. Browse to any page - Using DnSpy, attach to
w3wp.exe
process - Pause execution from debug menu
- Close all open modules
- List all modules in DnSpy.
Debug
->Windows
->Modules
- Right click any module and select
Open All Modules
- Set breakpoint on interesting functions
- Resume Execution
Compile DotNet file on the fly
C:\Windows\Microsoft.NET\Framework64\v4.0.30319\csc.exe C:\Users\Administrator\Desktop\test.cs
C:\Users\Administrator\Desktop\test.cs.exe
Tips and Tricks
- Search the source code for
@Html.Raw(ViewBag.div);
; Html.Raw renders what it is given without doing any html encoding