Debugging .NET web applications can sometimes be a bit tricky due to the optimizations that are applied to the executables at runtime. There is a way to modify how a target executable is optimized at runtime.
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
Disable Optimisations (Using dnSpy)
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
- The actual file is not used but instead the file is copied into a temp folder by IIS Worker:
C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Temporary ASP.NET Files\dotnetnuke\ - Right Click –> Edit Assembly Attributes (C#) –> Compile, then File –> Save Module
Debugging
- Debug –> Attach Process
- Find executable (w2wp.exe) and then modules (*.dll)
- Then should be able to send requests and intercept using the debugger
