RegAsm not being called on Installation of SmartTag Add-In

N

NickP

Hi there,

I am developing a SmartTag Add-In for Word 2007. I have the DLL
created, and it is strongly named as it also contains VSTO extensions for
Word 2007. I install the Assembly to the GAC, which works fine, but it
appears that the regasm call from the vsdraCOM flag does not work. I should
get a message box displayed on the screen just so I know that the
registration took place, unfortunately unless I make the regasm call
manually via the command line, it just does not happen.

Am I missing something? Also, is it important for the assembly to be
registered in the GAC for a SmartTag Add-in? I would rather it wasn't, but
if that is not possible then not to worry.

Many thanks in advance for your time and help.

Nick.
 
N

NickP

Hi there,

Just to add to this, I have stopped registering the assembly in the GAC
and in order to get RegAsm to run correctly, I have implemented an Installer
class within the DLL which performs the registration. This causes regasm to
be called correctly and my message boxes to fire.

The SmartTag appears in the Word 2007 Add-Ins list but does not seem to
do anything as yet, but with that said, the build in Outlook one doesn't
appear to do anything either. Maybe I have something setup wrong?

TIA

Nick.
 
N

NickP

I found the problem!

As I am writing all of my code in the same class library, and it was from a
VSTO add-in template, the "Register for COM interop" option was unavailable
for the project. This generates a tlb (type library), which is needed for
registration also. Once I included this it all started working.

Nick.
 
N

NickP

Sorry, just to clarify, this requires the use of a postbuild event as the
box is disabled...

C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\RegAsm.exe "$(TargetPath)"
/tlb:"$(TargetDir)$(TargetName).tlb"

Nick.
 
B

Bob Eaton

Yes, as you figured out, setting the property to vsdraCOM does not result in
RegAsm being called.

There is no way to do that except by using RegistrationServices as part of a
custom action (as you discovered), but even then, you have to be careful: if
the DLL is put into the GAC, you can't do such custom actions during
installation, because things get committed into the GAC only at the latter
stages of install (after custom actions are normally done).

It's a very tricky mess for sure. I think in the end, we put the DLL twice
on the system: once in the GAC for sharing and once in an unimportant folder
that we can do custom actions with.

Bob
 

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