Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Visual Studio attach to process and view the code on break?

Tags:

c#

.net

I must not have some configuration property set correctly...

Basically when I run the app as a service via srvany.exe, it starts, but a class doesn't get instantiated correctly. I've put in a 60 second delay to allow me to attach to the process, but I can't get that exe to break when it hits the break I set in the debugger (I guess that doesn't get compiled in?), and all I can view is the disassembler. Is it possible to do more?

like image 465
paIncrease Avatar asked Jan 29 '26 16:01

paIncrease


1 Answers

Sounds like VS may be assuming that SrvAny is stricly native code. When you attach to it, make sure that the "Attach to" box contains "Managed code" as a selection. Also, watch the debugger attaching to the process in the output window and make sure that it says "Symbols loaded" when your assemblies are loaded (indicating that the PDB file was found successfully)

like image 160
Ben Fulton Avatar answered Jan 31 '26 04:01

Ben Fulton



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!