Don't register for COM Interop

D

David Thielen

Hi;

This is for a C#/.NET Word add-in using IDTExtensibility2 (ie not VSTO).

It appears that if you delay sign an add-in (necessary if doing
obfuscation), then you must turn off registering it for COM interop. I
believe the reason why is it tries to register before the post-build event
and the post-build event is when you do the temp signing on a delay signed
app.

Am I missing something here? And is there any downside to not registering?

BTW - I first ran it without delay signing and with register set to get the
entries I need in the registry.
 
W

Wei-Dong XU [MSFT]

Hi dave,

Thanks for posting at the newsgroup!

I have reviewed your thread. Currently I am finding somebody who could help
you on it. We will post back in the newsgroup as soon as possible.

If there is anything unclear, please feel free to post in the group and we
will follow up then.

Best Regards,
Wei-Dong XU
Microsoft Product Support Services

When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
=====================================================
Business-Critical Phone Support (BCPS) provides you with technical phone
support at no charge during critical LAN outages or "business down"
situations. This benefit is available 24 hours a day, 7 days a week to all
Microsoft technology partners in the United States and Canada.
This and other support options are available here:
BCPS:
https://partner.microsoft.com/US/technicalsupport/supportoverview/40010469
Others: https://partner.microsoft.com/US/technicalsupport/supportoverview/

If you are outside the United States, please visit our International
Support page:
http://support.microsoft.com/default.aspx?scid=/international.aspx.
=====================================================
Get Secure! - www.microsoft.com/security
This posting is provided "AS IS" with no warranties, and confers no rights.
 
P

Peter Huang [MSFT]

Hi

Based on my test, after we create the Addin project, the correspose addin
register key has been created.
e.g.
HKEY_CURRENT_USER\Software\Microsoft\Office\Word\Addins\MyAddin4.Connect

If now we did not registered for com, then when the word attempt to find
the MyAddin4.Connect progid in registry, he will get nothing.
So after we delay sign and then sign the dll, we also need to call regasm
to register the managed dll as COM component, so that the addin will work.

Best regards,

Peter Huang
Microsoft Online Partner Support

Get Secure! - www.microsoft.com/security
This posting is provided "AS IS" with no warranties, and confers no rights.
 
P

Peter Huang [MSFT]

Hi

Your approach seems to be OK that you first register the dll with com
interop as then delete the dll to do delay sign issue.

Best regards,

Peter Huang
Microsoft Online Partner Support

Get Secure! - www.microsoft.com/security
This posting is provided "AS IS" with no warranties, and confers no rights.
 
D

David Thielen

Hello;

Are you saying to turn of "register COM" in the build properties and then in
the post-build event call regasm to register it after I do the delayed sign?
Do I just call "regasm AutoTag.dll" and do I need to do an unregister?

thanks - dave
 
P

Peter Huang [MSFT]

Hi

Yes, actually if we check the register for com interop, the IDE will do the
similar thing for us.
Also we may need to call the regasm test.dll /codebase, the /codebase
switch is necessary if we do not want to put the test.dll in GAC or in the
same directory of winword.exe.

Assembly Registration Tool (Regasm.exe)
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cptools/htm
l/cpgrfAssemblyRegistrationToolRegasmexe.asp

Also why do you think we need to unregister the dll, if we want to use a
NET exposed COM, we need to register it first just as we do with legacy
COM class.(regsvr32).

Best regards,

Peter Huang
Microsoft Online Partner Support

Get Secure! - www.microsoft.com/security
This posting is provided "AS IS" with no warranties, and confers no rights.
 
P

Peter Huang [MSFT]

Hi

I am glat my suggestion helps you.


Best regards,

Peter Huang
Microsoft Online Partner Support

Get Secure! - www.microsoft.com/security
This posting is provided "AS IS" with no warranties, and confers no rights.
 
Top