Running under debugger starts either 0 or 2 instances

D

David Thielen

Hello;

First off, I am a MSDN user but was not able to post via the managed
newsgroups web interface (MS tech support says they have problems with
that).

This is for an add-in written in C# and that has a COM shim.

I have a Word add-in that I have been able to run under my Visual
Studio debugger for some time with no problem. However, I recently had
to make two changes to it so that it would install correctly:
1. I moved the setup registry settings for my C# Connect class to the
machine/user hive.
2. I moved the registry settings in the .rgs file for the shim Connect
class to the machine/user hive in the setup program.

When I first did that, I could no longer run under the debugger. I
then ran the setup program on my computer from Visual Studio and it
then would start two instances of the add-in. I ran the uninstall and
it then would start no instances.

How can I get Visual Studio to start one instance of my add-in under
the debugger?

What registry or other settings do I need to make?

Is there a url somewhere that explains how to set an add-in up to run
it under the debugger?

thanks - dave
 
D

David Thielen

Hello;

***** On the development machine:

If I have just the shim registered I get one instance (good) but it it
not running under the debugger(bad). If I change the code and start
the debugger again, it does not show the new code. If I rename the
directory the program was installed to, the add-in does not run at all
(bad).

If I have just the C# Connect class registered I get one instance
(good) and it runs under the debugger (good). If I make a change in
the code it shows it. If I rename the directory the add-in was
installed to, it still runs under the debugger (good).

If I leave both entries in the registry, then one instance of the
add-in includes changes just made and breaks in the debugger and one
instance does not include changes made since the install and does not
break in the debugger.

Based on this, I think that the way Visual Studio is working, it
registers the C# Connect class so Word gets it from the build
directory and it will run under the debugger. But the shim never gets
to the build version and therefore you cannot debug loading via the
shim.

I also set a breakpoint in ConnectProxy.cpp (in the shim) and could
never get that to hit - neither with both classes in the registry and
with just the shim Connect class in the registry.

I also trid this both with registering and not registering the shim
dll.

***** On an end user machine:

The C# Connect being in the registry appears to be ignored. If I have
both in the registry or just the shim in the registry, it starts one
instance and runs fine.

If I have just the C# Connect in the registry nothing is loaded (even
with security set to lowest). I am guessing that this class is not in
the registry elsewhere and therefore canot be found to be loaded.


Am I missing something here?

Also, is there any MS document that explains:
1) Exactly how an add-in is loaded (ie what registry settings are
used, each step Word performs, each check it makes, each assumption it
has)?
2) Exactly how Visual Studio runs an add-in under the debugger so that
Word loads it and Visual Studio can debug it?

thanks - dave
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top