-1

Just as the title asks. I have solution with 5 projects in it. All dlls are connected with each other and whenever I start debugging, I can freely debug any of them. I'd like to add a separated project and access it's object by using reflection only (no references between the rest and 6th proj at all). Can I make it attach automatically to the debugger? I'm aware of function 'attach to existing process' but that's manual job.

Patryk
  • 3,042
  • 11
  • 41
  • 83

2 Answers2

1

You don't need anything special. Make sure you have pdb file next to the dll for that separate project, have source code locally matching to the version used to build that project, and possibly turn off "my code only" in tools -> options -> debug. At that point Visual Studio should pick up debugging information and allow you to set breakpoints and debug normally.

If PDB located somewhere else you can manually point to the PDP via debug->window->modules view by selecting "load symbols" from context menu on module you are interested to debug.

If sources don't match exactly you can instruct VS to use whatever you have also it likely will lead to confusing debugging experience (How does Visual Studio know if the source file matches the original version?).

Alexei Levenkov
  • 98,904
  • 14
  • 127
  • 179
0

You can put below line in your debugging dll ,in which function you want to debuge. it automatically ask you to attach with debugger

System.Diagnostics.Debugger.Launch();
Mukesh Methaniya
  • 752
  • 1
  • 5
  • 13