How to attach Visual Studio to Unity in order to debug a native dll?

Hello everybody.

I have a native dll which is used by a project in Unity 2019.4.35f1. Since the logic in the dll is complicated I would like to be able to debug it.

From the main answer here

I was able to log debug from inside the dll.

From the answer from this thread by Tomas1856, a Unity Technologies superuser, I get that the only way to really debug the native dll code line by line is to attach a debugger to the executable.

The problem is that I am not able to.

I have the dll Visual Studio 2019 project. It is build in debug mode. It’s pdb file is there. I have tried changing many project settings from advices I have read on the internet. But still when I press the play button in Unity and press the Attach to Process in Visual Studio the breakpoints I have put in the dll code all turn white with an error message “The breakpoint will not be hit. No symbols have been loaded for this document”.

I am attaching to the Unity.exe process. I have tried changing the output path for the dll and the pdb.

I am pretty sure I am missing something obvious.

Can someone provide any useful guidance, please?

After a month I have accidently found the reason. Error Pause was activated. I have logged an error so the Game has paused which makes it impossible to attach to the Unity process.
I hope this helps anyone.