none
DLL not registered in Add-In installation - VS2008 - Office2007 RRS feed

  • Question

  • Hi,

    I have a ClickOnce Word add-in (.vsto) that uses a third party dll (MoleZip.dll) to compress some files. The DLL appears in the project References as Interop.MoleZip.dll, and 'local copy' is set to "true".

    The add-in checks prerequisites, installs and loads fine, no error messages at all, but works partially only, it fails when is supposed to call MoleZip.dll to compress.

    However, the add-in works perfectly (compression included) if I previously register the molezip.dll with regsvr32 manually. How can get this dll automatically registered during installation? 

    Versions used here are VSTO3.0, VS2008, .Net Framework 3.5 and Word 2007.

    Thanks in advance.
    Wednesday, May 4, 2011 9:35 AM

All replies

  • Hi Ruben,

     

    Thanks for posting in the MSDN Forum.

     

    According to your description, you need to registry a third part dll when you deploy your add-in via click once.

     

    I would recommend you follow the article “Deploying COM Components with ClickOnce” . You can find how to deploy COM components step by step in this link:http://msdn.microsoft.com/en-us/library/ms165432(v=VS.100).aspx .

     

    I hope it can help you.

     

    Have a good day,

     

    Tom


    Tom Xu [MSFT]
    MSDN Community Support | Feedback to us
    Get or Request Code Sample from Microsoft
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Thursday, May 5, 2011 10:45 AM
    Moderator
  • Hi Tom,

    thanks for your reply. The solution you pointed out is exactly what I needed. I had to click on the COM object in references, set Isolated=True, publish and it should work. But it fails when I try to install, giving the following error:

    'threadingModel' attribute is invalid - The value 'both' is invalid according to its datatype

    I found this thread where another user had the same issue. The following solution was suggested:

    It's all about the case sensitive of xml schema validation. In my case I just changed the value of ThreadingModel of my com class from 'both' to 'Both' in registry then the problem goes away.

    the problem goes away but seems like I need to re-sign it.

    So I guess I'll have to follow this other link I found googling:

    http://blogs.msdn.com/b/vsto/archive/2009/04/29/signing-and-re-signing-manifests-in-clickonce.aspx

    Signing and re-signing manifests in ClickOnce (Saurabh Bhatia)

     

    I'll report back when I try this, I hope I can get it solved. If you find anything wrong in this process any corrections will be appreciated.

    • Edited by Ruben ASIC Monday, May 9, 2011 10:44 AM wrong format
    Monday, May 9, 2011 10:43 AM
  • Hi Ruben,

     

    Did you read http://msdn.microsoft.com/en-us/magazine/cc188708.aspx? I think it worth to try.

     

    Have a good day,

     

    Tom


    Tom Xu [MSFT]
    MSDN Community Support | Feedback to us
    Get or Request Code Sample from Microsoft
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Tuesday, May 10, 2011 2:37 AM
    Moderator
  • Hi Tom,

    I had already read that link. Ultimately, I only had to set Isolated=True for the DLL in the references. I believe this step is already sorted out. Thanks anyway for the input.

    Today, I've changed 'both' to 'Both' as previously explained. Then I went through the manual signing process by Saurabh Bhatia. At some point, it complains some files can't be found because they are renamed to .deploy. It asked for MoleZip.dll not being found among others, which didn't happen earlier, so that means he is actually including it. (The renaming thing is explained in detail in the link).

    Signing went ok, installation too, but now the add-in is not loading, the buttons are not showing. The complement seems to be installed, it shows in word options/complements as active and is set to load at startup. I'm stuck in there. Any ideas on what should I check now?

    Thanks again for your help.

    Tuesday, May 10, 2011 11:08 AM
  • Just an update:

    When, after the same installation as in the previous post, I manually register MoleZip.dll (regsvr32), the add-in loads and works fine. Then if I unregister it, i.e. just as it was after installing normally, the add-in won't load.

    This is a different behaviour from when it was deployed with Isolated=False, where it loaded and worked partially until you were calling the DLL.

    In the end, I think this Registration-Free COM technology is either not working or I'm doing something wrong.

    Any help will be greatly appreciated.

    Wednesday, May 11, 2011 8:51 AM
  • I'm trying to carefully recheck all the steps from the first link you suggested.

    Isolating: If this property is True, it causes a manifest to be generated for this component at build time. It also causes the corresponding files to be copied to the application folder during installation.

    No independent manifest for my DLL is being created, however my MoleZip.dll appears referenced in MyAddIn.dll.manifest, which didn't happen previously. I think this is fine.

    When I add the reference, I choose the COM object (from system32 folder) in the References menu, but then in the references list/properties name is Interop.MoleZip.dll. Is this the expected behaviour?

    This file is also referenced in the manifest. Why twice, with and without Interop? Only with Interop appeared before isolating.

    There is a Interop.MoleZip.dll file copied in the results folder, however, there is no MoleZip.dll, despite when I go through the manual signing process, asks for it, detecting the need for it. Local copy is set to true. Manually adding the file doesn't solve the problem either.

    If you examine the published files, you will note that the sysmon.ocx file is included.

    This is not happening, there is no such file. Should I include it manually copied from somewhere else? I don't have much hope for it to work either.

    Wednesday, May 11, 2011 10:31 AM
  • Hi Ruben,

     

    I try to reproduce your issue on my side, but I don’t what’s matter with my computer, it crashed frequently. I’m reinstalling my System now. I will show your my research result as fast as I can.

     

    Thanks for your understanding.

     

    Have a good day,

     

    Tom


    Tom Xu [MSFT]
    MSDN Community Support | Feedback to us
    Get or Request Code Sample from Microsoft
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Thursday, May 12, 2011 7:11 AM
    Moderator
  • Hi Tom,

    Thanks a lot for trying to reproduce the issue. The DLL I'm using is freeware but its original website seems to be down, so let me know if you want me to provide you with it. 

    All the best with the reinstallation!

    Ruben.

    Thursday, May 12, 2011 8:33 AM
  • Hi Ruben,

     

    It will make more sense if your provide the dll file for me for further research. Otherwise I create a COM component via C++ to reproduce your issue.

     

    Have a good day,

     

    Tom


    Tom Xu [MSFT]
    MSDN Community Support | Feedback to us
    Get or Request Code Sample from Microsoft
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Friday, May 13, 2011 7:31 AM
    Moderator
  • Please write me to rumopro<at>teleco.upv.es, or please give me your address if you prefer.

    Thanks again.


    Friday, May 13, 2011 8:22 AM
  • Hi Ruben,

     

    Did you receive my email?

     

    Have a good day,

     

    Tom


    Tom Xu [MSFT]
    MSDN Community Support | Feedback to us
    Get or Request Code Sample from Microsoft
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Tuesday, May 17, 2011 8:21 AM
    Moderator
  • Yes I just replied attaching the DLL.
    Tuesday, May 17, 2011 9:13 AM
  • Hi Ruben,

     

    I found a work round, please follow the steps:

     

    1.       Create a msi project to register your free dll file.

    2.       Create a Custom Bootstrapper for you msi file. http://msdn.microsoft.com/en-us/library/ms165429(v=VS.90).aspx

    a)       You need to make a package.xml in your “[Assembly name]\en folder” folder like http://msdn.microsoft.com/en-us/library/ee335702.aspx

    b)       You need to make a produce.xml in you “[Assembly name]” folder like http://msdn.microsoft.com/en-us/library/ee335701.aspx

    3.       Select this assembly in your add-in project’s properties->Publish->prerequisites…

    4.       Select “download prerequisites form the same location as my application”

    5.       Publish it.

     

    I run these on my side I hope it can work on your side too.

     

    If you have any questions for it, please feel free to let me know.

     

    If it work for you please mark it as answer.

     

    Have a good day,

     

    Tom


    Tom Xu [MSFT]
    MSDN Community Support | Feedback to us
    Get or Request Code Sample from Microsoft
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Wednesday, June 1, 2011 10:00 AM
    Moderator
  • Hello,

    after having been assigned to another project for a while, I'm back with this.

    I'd like to ask a question about the first step:

    1.       Create a msi project to register your free dll file.

    Should I create a msi installation project inside my current solution, or create it separately? I think this would affect the manifests creation afterwards.

    Then, I plan on following these steps.

    Thanks in advance.

    Rubén.

    Monday, June 27, 2011 11:00 AM
  • Hello,

    I thought I'd report back how it went, in case it's useful for someone else. I got it working in the end.

    I created an independent msi project file, following the steps from the link above.

    Then, I tried to manually create produce.xml and package.xml following the links Tom provided, but it was not showing up in the prerequisites box. So I used this manual for the BMG program and it worked. In order to find the proper condition check, I used RegDllView to find out the registry key that was being created. It is under HKEY_CLASSES_ROOT\CLSID\ just in case it helps.

    Then I published it and is working.

    I've tested under both Word2007 and Word2010 and it works fine, surprisingly for me because I thought this being developed with VS2008 and VSTO3.0 it might not work with 2010 versions.

    Thanks a lot for your help Tom!

    Thursday, July 7, 2011 3:50 PM