To better explain, I'll give some context.
I have an application that loads a library dynamically on runtime. The library is some sort of a plugin and the application is intended to test the plugin.
In order to be able to debug the plugin, I open VS Code with the plugin project and I attach the debugger to the application that is already running and has already loaded the plugin. The plugin assembly has been built and has a nice PDB file.
So the workflow follows: Application => load plugin => attach debugger
First of all, this works, even with the application published in release. That is because the plugin loaded is built in debug and so the PDB is there.
However, there's a scenario where I can't seem to attach properly or the symbols aren't loaded. And this is if I publish the application with the /p:PublishSingleFile=true
flag. In this scenario a single file is generated and when I try to attach the debugger it just doesn't work.
Can anyone provide any insights on this? Or a possible solution?
It's worth saying that I'm using .NET 5
Cheers
<DebugType>embed</DebugType>
as mentioned in the .NET 5.0 Announcement? – Moynahan