Debugging [dnSpy]

You can reset iis by pasting the following command in the cmd window:

iisreset /noforce

Change the following attributes

Change this (by clicking right mouse button > Edit Assemblies):

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

To this:

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

After modififcation click Compile and then File > Save Module.

Now you can set breakpoints.

Attach debugger to process

The process when it comes to .NET application should be called w3wp.exe

In order to attach our dnSpy debbuger to web application we have to:

Debug > Attach to Process

And then select the process of the web applicaton (if you are unable to see it you have to visit the site in the first place)

Then click Attach.

Close all assemblies

In order to start debugging we have to load all modules required to set breakpoints but before we will do that, first we have to close all assemblies.

File > Close All

Stop debugging

After closing the assemblies it is advised to stop debugging process.

Load all modules

Now we can load all modules in order for them to be accessible by breakpoints.

Move to: Debug > Windows > Modules

Then: Right click on any module > Open all modules

After that we can continue our debugging process by clicking Continue. Right now we can set any breakpoints and begin with the testing.

[DONE]

Right now we can talk a little bit about debugger modes:

Call Stack

If you want to see which functions have been triggered from the breakpoint you can use Call Stack.

Locals

If you want to see the current variable values you can use Locals tab.

Last updated