none
Can't add VSTO Inclusion List entry when only .NET 4 is installed RRS feed

  • Question

  • I am following the instructions in this article to add an Inclusion List entry for my VSTO add-in during installation:

    http://msdn.microsoft.com/en-us/library/bb398239.aspx

    This technique works fine on a machine with .NET 2, 3, 3.5, and 4 installed. However, we need to deploy our solution to machines that only have .NET 4 Client Profile.

    The article says to "Add a reference to Microsoft.VisualStudio.Tools.Office.Runtime.v10.0". If you look on a machine with multiple versions of the .NET Framework, where the VSTO Runtime is installed, you will see two very similar DLLs in the GAC:

    C:\Windows\assembly\GAC_MSIL\Microsoft.VisualStudio.Tools.Office.Runtime.v10.0\10.0.0.0__b03f5f7f11d50a3a\Microsoft.VisualStudio.Tools.Office.Runtime.v10.0.dll

    C:\Windows\Microsoft.NET\assembly\GAC_MSIL\Microsoft.VisualStudio.Tools.Office.Runtime\v4.0_10.0.0.0__b03f5f7f11d50a3a\Microsoft.VisualStudio.Tools.Office.Runtime.dll

    The first one is the one the article says to reference. The second one is the .NET 4 version of this DLL. On a machine with only .NET 4, only the second one will be installed on the machine.

    This causes two major problems:

    1. There no reference assembly for the .NET 4 version of this DLL, so adding it to your project is problematic.

    2. If you open the .NET 4 version of this DLL in Reflector, you will see that the Microsoft.VisualStudio.Tools.Office.Runtime.Security.UserInclusionList class referenced in the article has been changed to internal. This makes it impossible to use from our code.

    How are we supposed to add an Inclusion List entry on a machine with only .NET 4 Client Profile?

    Thursday, June 9, 2011 3:06 PM

All replies

  • Hi RScullard,

    ">> If you open the .NET 4 version of this DLL in Reflector, you will see that the Microsoft.VisualStudio.Tools.Office.Runtime.Security.UserInclusionList class referenced in the article has been changed to internal. This makes it impossible to use from our code."
    Please take a look at this article: http://msdn.microsoft.com/en-us/library/bb608607.aspx, it points that Visual Studio 2010 Tools for Office Runtime no longer checks the inclusion list because the Office solutions have already been granted FullTrust permission

    Hope this can explain the scenario.

    Best Regards,


    Bruce Song [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, June 13, 2011 6:36 AM
  • What that article actually says is:

    For Office solutions in the Program Files directory, the Visual Studio 2010 Tools for Office Runtime no longer checks the inclusion list because the Office solutions have already been granted FullTrust permission.

    A requirement of our installer is that it not require administrative rights, so we don't install our add-in into the Program Files directory, but rather into the user's Application Data directory. This means that we still need to add the add-in to the Inclusion List to avoid the trust prompt.

    Since it seems that the Microsoft-recommended approach isn't going to work any time soon, we have implemented the workaround of having our installer directly write the inclusion list registry settings, rather than using the UserInclusionList.Add API from the MSDN article. If there is any downside to doing this, please let me know!

    Monday, June 13, 2011 12:54 PM