Psychic debugging…

Ray wrote a post entitled “Psychic Debuggin: IP on heap“, where he talks about somebody being amazed at his abilities to debug something immediately.

Which brought something to mind (which I hope I haven’t written about before (I did a quick search and didn’t find anything ))

Perhaps 4 or 5 times, I’ve come across the following question:

I’m implementing an add-in architecture for my application. I’m able to load the add-in assembly and create an instance of a type, but I get an exception when I try to cast it to an interface.

The answer – and it’s *always* been this answer for me – is the following (highlight to view):

You have the interface defined in your main program and in the add-in, and the assembly is part of the type’s identity, so the two interfaces are not the same type.

Which is really obvious when you’ve come across it a couple times, but there is a certain degree of satisfaction to be able to diagnose it correctly from afar.

Do you have any examples of psychic debugging?


Comments (4)

  1. Matt says:

    Stack Overflow Exception.

    I would put money on someone having implemented a recursive property by accident (probably via intellisense since they wrote the property before they wrote the field).

  2. File not found.

    "This code works perfectly when I run it standalone under a test jig, but fails when I run it as an add-in under a service."

    When run as an application, the current working directory is the same as the AppDomain.BaseDirectory. When running under a service, the default current working directory is <HomeDrive>WindowsSystem32. moral: don’t assume anything about default directories, always specify a full path.

    ‘course, lots of other things change when running as a service, but this one always surprises people.

  3. psychic kentucky medium <a href= >medium african psychic</a> [url=]medium african psychic[/url]