none
Register .Net Add-In for both 32 and 64 bit versions of Office RRS feed

  • Question

  • I'm developing an application add-in for Office using C# in Visual Studio 2010. I've noticed that the add-in installs just fine into the 32bit version of Office but won't load in the 64bit version of Office. After a bit of research I was able to figure out that the reason for this is that my setup project is set to a TargetPlatform of x86 and therefore registers my .net asemblies for COM interop in the Wow6432Node. As such, the 64 bit version of Word isn't able to able to successfully CoCreate my add-in as it does not "see" the Wow6432Node.

    Of course, this is easily solved by changing the TargetPlatform of the setup project. However, I would really like to avoid having two separate installers. I build my asemblies to target "Any CPU" and they work just fine on either x86 or x64. So, literally, the only difference between the two setups is the location of my COM CLSID that is pointed to by the ProgId of my Add-In.

    I'm tempted to write an MSI custom action to invoke the 64bit version of regasm on my assembly but that seems like it would be violating one of the principles of MSI installs. Is there a better way to accomplish this?

    Friday, October 21, 2011 11:13 PM

Answers

  • Hi,

    It seems that you are deploying your VSTO add-in by using Windows Installer. I would have to tell you that creating a single MSI that will install for buton 32-bit and 64-bit Office version is not possilble as far as I know.

    Check the document below for more details:

    http://msdn.microsoft.com/en-us/library/ff937654.aspx?wa=wsignin1.0

    But if you deploy the solution by ClickOnnce, you don't need to worry about the issue problem. By setting the Target Platform to "Any CPU" will work for both 32-bit and 64-bit Office.

    I hope this helps.


    Best Regards, Calvin Gao [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.

    Monday, October 24, 2011 3:41 AM
    Moderator

All replies

  • Hi,

    It seems that you are deploying your VSTO add-in by using Windows Installer. I would have to tell you that creating a single MSI that will install for buton 32-bit and 64-bit Office version is not possilble as far as I know.

    Check the document below for more details:

    http://msdn.microsoft.com/en-us/library/ff937654.aspx?wa=wsignin1.0

    But if you deploy the solution by ClickOnnce, you don't need to worry about the issue problem. By setting the Target Platform to "Any CPU" will work for both 32-bit and 64-bit Office.

    I hope this helps.


    Best Regards, Calvin Gao [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.

    Monday, October 24, 2011 3:41 AM
    Moderator
  • I'm not using VSTO and Click Once is not an option for me even if I was. I ended up writing a Windows installer custom action that opens up the registry using RegistryView.Registry64 and manually copying the key structure into place by reading them from the default registry view. I'm not thrilled about using a custom action, but having a single install is a far superior experience to having to maintain an install for each processor architecture just to get two registry keys written to the right section of the registry.
    Tuesday, November 1, 2011 7:51 PM