9 Replies - 1408 Views - Last Post: 26 April 2012 - 07:03 AM Rate Topic: -----

#1 negligible  Icon User is offline

  • D.I.C Regular

Reputation: 62
  • View blog
  • Posts: 302
  • Joined: 02-December 10

Can't step into Interface

Posted 25 April 2012 - 07:51 AM

This has turn a quick fix into an immensely frustrating afternoon.

I have two projects in my solution Bridge and BridgeInterface being used by my applications update process and it's throwing a FileLoadException when I try to run use the Initialize() method from the Bridge class.

The problem is I can't step into this method, and I have run out of ideas, I need to see where the fault lies in the code!

The Bridge projects where not originally originally part of the solution, so I added both the projects and have pointed to their PDB symbol files. (The .DLL's are showing as symbols loaded in the modules window.)

I also have "Just My Code" unchecked and all projects in the solution are targetting the .NET 4 Full Profile.

Any ideas?

Is This A Good Question/Topic? 0
  • +

Replies To: Can't step into Interface

#2 eclipsed4utoo  Icon User is offline

  • Not Your Ordinary Programmer
  • member icon

Reputation: 1524
  • View blog
  • Posts: 5,957
  • Joined: 21-March 08

Re: Can't step into Interface

Posted 25 April 2012 - 07:53 AM

So you can't put a breakpoint on the line of code that throws the error?

You can't "step into" an interface. There's nothing to step into. There is no executing code in an interface.
Was This Post Helpful? 0
  • +
  • -

#3 negligible  Icon User is offline

  • D.I.C Regular

Reputation: 62
  • View blog
  • Posts: 302
  • Joined: 02-December 10

Re: Can't step into Interface

Posted 25 April 2012 - 08:05 AM

I can put a breakpoint on the line that throws an error, just when I press F11 it steps over it.

I need debug the method in the Interface implementer "Bridge", because as you rightly say there is no executing code in an interface.

(Looks like I can't rename the title)

This post has been edited by negligible: 25 April 2012 - 08:07 AM

Was This Post Helpful? 0
  • +
  • -

#4 eclipsed4utoo  Icon User is offline

  • Not Your Ordinary Programmer
  • member icon

Reputation: 1524
  • View blog
  • Posts: 5,957
  • Joined: 21-March 08

Re: Can't step into Interface

Posted 25 April 2012 - 08:07 AM

What code throws the error? Is it your code?
Was This Post Helpful? 0
  • +
  • -

#5 negligible  Icon User is offline

  • D.I.C Regular

Reputation: 62
  • View blog
  • Posts: 302
  • Joined: 02-December 10

Re: Can't step into Interface

Posted 25 April 2012 - 08:17 AM

Yes, the exception is definitely being thrown from "my" code.

It's an exception is recognise, it's normally caused by these version numbers in the assembly exe.conf (relating to a MIS we give extra functionality to) not matching the version on our server.
However something strange is happening, which is why I would really like to to get the debugger in the code.

This post has been edited by negligible: 25 April 2012 - 08:19 AM

Was This Post Helpful? 0
  • +
  • -

#6 AdamSpeight2008  Icon User is offline

  • MrCupOfT
  • member icon


Reputation: 2240
  • View blog
  • Posts: 9,411
  • Joined: 29-May 08

Re: Can't step into Interface

Posted 25 April 2012 - 08:18 AM

The implementer may have put attributes on the methods to skip over the code, like DebuggerStepperBoundary
Was This Post Helpful? 1
  • +
  • -

#7 negligible  Icon User is offline

  • D.I.C Regular

Reputation: 62
  • View blog
  • Posts: 302
  • Joined: 02-December 10

Re: Can't step into Interface

Posted 25 April 2012 - 08:49 AM

Not that I can see, the only use of the Diagnostics class outside of the Designer pages is when I return FileVersionInfo and use Process.Start :(

This post has been edited by negligible: 25 April 2012 - 08:52 AM

Was This Post Helpful? 0
  • +
  • -

#8 AdamSpeight2008  Icon User is offline

  • MrCupOfT
  • member icon


Reputation: 2240
  • View blog
  • Posts: 9,411
  • Joined: 29-May 08

Re: Can't step into Interface

Posted 25 April 2012 - 01:30 PM

Attributes are meta-data associated with the code, and are usually just before the start of a method.
Was This Post Helpful? 0
  • +
  • -

#9 negligible  Icon User is offline

  • D.I.C Regular

Reputation: 62
  • View blog
  • Posts: 302
  • Joined: 02-December 10

Re: Can't step into Interface

Posted 26 April 2012 - 02:09 AM

I fixed this by removing the original referenced assemblies to Bridge and BridgeInterface then adding the projects as references instead.
Was This Post Helpful? 0
  • +
  • -

#10 lordofduct  Icon User is offline

  • I'm a cheeseburger
  • member icon


Reputation: 2528
  • View blog
  • Posts: 4,630
  • Joined: 24-September 10

Re: Can't step into Interface

Posted 26 April 2012 - 07:03 AM

You can't step into an interface?

Or do you mean you can't step into a class that implements your interface?

It's not just that you can't step into interfaces because they have no code. You can't create instances of an interface either! There should never be a time when you could even attempt to step into an interface... only when you can step into a class that implements said interface.



If you can't step into something it's because Visual Studio doesn't have the .PDB file to use for stepping into code of referenced libraries. That's why adding the reference 'as project' fixed your problem, when it builds, it generates those .pdb files. You may have also had your project debug settings set to "step into just my code", if the code isn't part of your solution, it isn't considered "your code".

This post has been edited by lordofduct: 26 April 2012 - 07:04 AM

Was This Post Helpful? 0
  • +
  • -

Page 1 of 1