1

I have a method1 which calls a method2 in a type that's resolved dynamically during run time. The type is resides in referenced assembly whose source I have. I put a breakpoint in method1 on the call on method2 and I have a breakpoint on method2 in its .cs file. I am using Visual Studio 2015 update 3 and Resharper. (I have CodeRush too).

I can't single step into method2 and I can't go to implementation of method2. The debugger single steps to the next line before single stepping into method2. ctrl-alt-click on method2 shows a "Implementations of method2 were not found". ctrl-click on method2 goes to its interface.

I was wondering how to break into method2 during debugging.

Tony_Henrich
  • 42,411
  • 75
  • 239
  • 374
  • If you disable/remove the Resharper tool, and then debug your app using the VS IDE "Step Into(F11)", how about the result? Whether the two class methods in different projects or just different class files in the same project? Which kind of apps did you really create,VC++/C#? Is it the Mix mode debugging? Do you enable the "Use Managed/Native Compatibility Mode" under Tools->Options->Debugging? Please also make sure that no build error firstly. – Jack Zhai Jan 12 '17 at 02:28
  • I am using c# only. Both modes are off. It's not mixed mode. method2 is in a class file from a project that's not part of the solution. Its assembly is referenced. – Tony_Henrich Jan 13 '17 at 06:03
  • @ Tony, If you disable both modes one by one, how about the result? Do you make sure that the second class method was really called during you run your app? You could output certain messages in the reference class, and visit the output result. At least, we know that whether it was called. Maybe you forget to set the dll reference property "copy local=True" or others. – Jack Zhai Jan 13 '17 at 12:05
  • what about this issue if you use the project reference instead of the assembly reference? Please check your debug module window which really load the assembly: http://stackoverflow.com/questions/654696/how-to-debug-external-class-library-projects-in-visual-studio and https://social.msdn.microsoft.com/Forums/en-US/abe9aa4f-5810-4386-9206-532df4d28306/stepping-into-a-referenced-dll?forum=vbide, and make sure that all projects use the same .NET Framework version. If you get any latest information, please feel free to let me know. – Jack Zhai Jan 17 '17 at 05:56
  • As of now I don't have the need anymore, When a similar situations comes up, I will try these tips. Thanks for the tips. Hopefully it will benefit other devs. – Tony_Henrich Jan 18 '17 at 02:28
  • so you have resolved this issue, am I right? Would you mind adding the comment as the answer for this issue? So it could help other community members who meet the same issue?:) – Jack Zhai Jan 18 '17 at 02:40
  • I didn't resolve it. I resolved the parent issue that had me want to single step through some 'outside' code. When I have some time, I will create a similar condition and try those tips. – Tony_Henrich Jan 19 '17 at 03:36
  • I look forward to hearing from you. Of course, if you have some time and try my suggestion, please feel free to share the latest information/result here. I provide the possible reasons which will impact the referenced assembly debugging. I just add it as the temporary answer, so it could also help other community members:) Have a nice day! – Jack Zhai Jan 19 '17 at 06:21

1 Answers1

0

(1) un-check Require source files to exactly match the original statement and Enable Just my Code under TOOLS->Options->Debugging.

(2) For the reference assembly debugging, please make sure that the dll file and the PDB file are all copied to the project output(Bin\debug) path which refer to it.

(3) Please check that whether it really loaded this assembly under Debug->Modules windows during debugging mode.

(4) Using the project reference installed of the assembly reference also could help you narrow down this issue.

Jack Zhai
  • 6,230
  • 1
  • 12
  • 20