In my project I use Assembly.LoadFile(assemblyPath);
to load dll from other local project at the runtime (reasons for that don't matter). Is it somehow possible from code, to open new instance of visual studio (with project from dll) and after that attach debugger to the process that is already running?
Asked
Active
Viewed 103 times
-1

大陸北方網友
- 3,696
- 3
- 12
- 37

Adam Stawarek
- 321
- 4
- 9
-
1The odds that "no" is the correct answer are about as good as you having picked the wrong Assembly.Load method. Only one debugger can be attached to a process. So use the one you're already using. Equal odds for you favoring Tools > Options > Debugging > General, "just my code" unticked. – Hans Passant May 24 '20 at 21:36
-
1Here is a related thread that maybe can help you.[Attach debugger in C# to another process](https://stackoverflow.com/questions/11811856/attach-debugger-in-c-sharp-to-another-process). – 大陸北方網友 May 25 '20 at 06:54
-
Thanks @KyleWang, i was looking for something like that – Adam Stawarek May 25 '20 at 21:42
1 Answers
0
You can try using Debugger.Launch. It should open "Choose Just-In-Time Debugger" dialog like this (at least if debugger is not already attached):

Guru Stron
- 102,774
- 10
- 95
- 132
-
the project to which i was trying to attach debbuger was library, so it had no entry point in which i could add Debbuger.Lanuch. – Adam Stawarek May 25 '20 at 21:40