"Oleg Starodumov" <com-dot-debuginfo-at-oleg> schrieb
[quoted text, click to view] >
> Hi Armin,
>
> > after reading the documentation, I still don't know how to debug
> > an assembly registered for COM interop. I have a COM client
> > (written in VB6) calling my VB 2003 COM assembly. I'd like to
> > debug the assembly (setting breakpoints, step through etc.).
> > Everything I tried failed. Anybody knows how to do it?
> >
>
> Try this:
>
> 1. File | Open Solution, open the .exe file of the VB6 client.
> 2. Project properties | Configuration Properties | Debugging,
> set Debugger Type to "Managed only".
> 3. Set breakpoints in the VB.NET assembly's source files and start
> debugging.
>
> You can also set Debugger Type to Mixed if you want to debug VB6
> code too, but do not set it to Auto or Native Only - it will
> disable managed code debugging.
Hi Oleg,
thx for answering. After step 2, how can I do 3? Only the exe is in the
solution. If I start another IDE instance, I can not start this 2nd instance
because it's a class library.
I've tried several things. One way is opening the .Net project in the IDE,
set the "start external process" to the client.exe. As soon as my method in
the project is called, the client.exe quits immediatelly without any message
and without a trappable error. This happens with and without a breakpoint.
My method is not even called because, when setting a breakpoint, it is not
hit. Without a breakpoint and other sort of tracing, like a msgbox or
logging to a file, the method is not called, too. This happens when "[ ]
enable unmanged debugging" is off. If it's on, the .Net IDE crashes (in
module mscordbi.dll) as soon as my method is called. I've googled a long
time to solve this but all I did was not successful.
Another way I tried: Start the client.exe. It must call a function in my
assembly one time in order to be able to use "attach to process" in the .Net
IDE. When trying to attach to the process with debug type "Common language
runtime" enabled only, I get the message "can not attach to process """
(empty quotes). Using "native only", I can attach to the process, but, as
expected, the breakpoint will never be hit.
What I also did (after reading some hours yesterday) is, sign the assembly,
optionally register it in the GAC (I tried with and without), and register
it (using regasm) using the /codebase option. Nothing helped.
What I did, too: Used "cordbg.exe" to attach to the running client.exe.
While the IDE only shows that it can not attach to the process, cordbg gives
this messsage:
"Error: hr=0x8013134b, The process cannot be debugged because the debugger's
internal debugging protocol is incompatible with the protocol supported
by the process."
I've also searched for this error but all I can find is referring to
registering ASP correctly.
I ran out of ideas meanwhile. I'll now reinstall the framework. If this
doesn't help, too, I will consider doing a repair install of VS.Net. But
anyhow I have the idea that this won't work, too.... I'm running VB
Express 2005 on the same machine. Mabe this destroyed something? I didn't
find out anything what I can do (apart from uninstalling it; which wouldn't
make sense because I will have to reinstall it because I want to use it).
Armin