Search code examples
c#debuggingvb6com-interopvisual-studio-express

How to debug vs 2008 c# express dll which is called by a vb6/vba app?


i have a c# dll which is written to act as a wrapper to grab data from a data source and pass it to a vba/powerpoint ppa application. i don't have much experience with vba which is why i'm simulating this using vb6 which i know a tiny bit more about.

i'm having enough problem as of now trying to understand the syntax and what not for the intricate workings of com and ccw. so i'm looking for a way to debug on why the function isn't returning me any data, and if possible have a line by line walkthrough of the .net dll when the vb6 app is calling it.

initially i thought of putting in a function inside the .net dll which will write out to an external file but that doesn't seems to be working and i don't know why.

i did some googling and found out that there's a attach to process which could be useful for my case but that feature is only available in vs studio full version.

so i'm hoping there's other tools, methods that i can use which can allows me to properly debug what's going on between the vb6/vba app and the .net dll.

thanks.


Solution

  • Too bad attach to process isn't available to you because that is the way to go.

    A well placed Debug.Assert(false); in the .net dll is one way to force a debugger to show up.

    You could also try Debugger.Break(); which should force a breakpoint and ask you if you want to attach a debugger.

    Both Debug and Debugger are in the System.Diagnostics namespace.