Debug with dnspy - DNN

1. Enable Debugger - dnn offsec

To reduce the amount of optimization performed at runtime, we can change that attribute.

Right click and go to Edit Assembly Attributes

Delete

[assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]

Add

[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]

Then Save Module

2. Attach Debugger

Pause the process by break all.

Attach to process.

Select w3wp.exe
why? --> This is the IIS worker process under which our instance of DNN is running.