none
Application Manifest question RRS feed

  • Question

  • Hi,

    I am trying to manipulate application manifest generated using VSTO 3.0 for Outlook Addin to change the entry point  to use to an older DLL that was generated using the VSTO SE 2005 targeted to Office 2007. I have used the Mage tool to sign and update both application and deployment manifest  along with replacing the newer DLL with the older one. But when the Add-in loads it throws an exception, saying that it is not able to find the MyApplication.ThisAddIn in the MyApplication.dll. If I switch to back to the DLL that was generated using the VSTO 3.0 then it works fine.

    Here is the error detail:

    Customization could not be loaded because the application domain could not be created.


    ************** Exception Text **************
    Microsoft.VisualStudio.Tools.Applications.Runtime.CannotCreateCustomizationDomainException: Customization could not be loaded because the application domain could not be created. ---> System.ArgumentException: The type "MyApplication.ThisAddIn" could not be found in assembly "c:\dev\MyApplication.dll"
       at System.AddIn.Hosting.AddInStore.FindAddIn(Type hostViewOfAddIn, String pipelineRootFolderPath, String addInFilePath, String addInTypeName)
       at Microsoft.VisualStudio.Tools.Applications.AddInStoreExtensions.FindAddIn(AddInInformation addInInformation, String pipelinePath, Type hostAddInView, SegmentConstraints[] segmentConstraints)
       at Microsoft.VisualStudio.Tools.Office.Runtime.DomainCreator.LoadMafPipeline(AppDomain newDomain, IntPtr hostServiceProvider, AddInInformation info, EntryPoints requestedEntryPoints, OfficeApp officeApplication, OfficeVersion officeVersion, IntPtr& executor)
       at Microsoft.VisualStudio.Tools.Office.Runtime.DomainCreator.CreateCustomizationDomainInternal(String solutionLocation, String manifestName, String documentName, Boolean showUIDuringDeployment, IntPtr hostServiceProvider, IntPtr& executor)
       --- End of inner exception stack trace ---


    ************** Loaded Assemblies **************
    mscorlib
        Assembly Version: 2.0.0.0
        Win32 Version: 2.0.50727.4952 (win7RTMGDR.050727-4900)
        CodeBase: file:///C:/Windows/Microsoft.NET/Framework64/v2.0.50727/mscorlib.dll
    ----------------------------------------
    Microsoft.VisualStudio.Tools.Office.Runtime.v10.0
        Assembly Version: 10.0.0.0
        Win32 Version: 10.0.21022.1
        CodeBase: file:///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
    ----------------------------------------
    System
        Assembly Version: 2.0.0.0
        Win32 Version: 2.0.50727.4927 (NetFXspW7.050727-4900)
        CodeBase: file:///C:/Windows/assembly/GAC_MSIL/System/2.0.0.0__b77a5c561934e089/System.dll
    ----------------------------------------
    System.Core
        Assembly Version: 3.5.0.0
        Win32 Version: 3.5.30729.4926 built by: NetFXw7
        CodeBase: file:///C:/Windows/assembly/GAC_MSIL/System.Core/3.5.0.0__b77a5c561934e089/System.Core.dll
    ----------------------------------------
    System.AddIn
        Assembly Version: 3.5.0.0
        Win32 Version: 3.5.30729.4926 built by: NetFXw7
        CodeBase: file:///C:/Windows/assembly/GAC_MSIL/System.AddIn/3.5.0.0__b77a5c561934e089/System.AddIn.dll
    ----------------------------------------
    Microsoft.VisualStudio.Tools.Applications.Hosting.v10.0
        Assembly Version: 10.0.0.0
        Win32 Version: 10.0.21022.1
        CodeBase: file:///C:/Windows/assembly/GAC_MSIL/Microsoft.VisualStudio.Tools.Applications.Hosting.v10.0/10.0.0.0__b03f5f7f11d50a3a/Microsoft.VisualStudio.Tools.Applications.Hosting.v10.0.dll
    ----------------------------------------
    Microsoft.VisualStudio.Tools.Applications.Runtime.v10.0
        Assembly Version: 10.0.0.0
        Win32 Version: 10.0.21022.1
        CodeBase: file:///C:/Windows/assembly/GAC_MSIL/Microsoft.VisualStudio.Tools.Applications.Runtime.v10.0/10.0.0.0__b03f5f7f11d50a3a/Microsoft.VisualStudio.Tools.Applications.Runtime.v10.0.dll
    ----------------------------------------
    Microsoft.VisualStudio.Tools.Applications.ServerDocument.v10.0
        Assembly Version: 10.0.0.0
        Win32 Version: 10.0.21022.1
        CodeBase: file:///C:/Windows/assembly/GAC_MSIL/Microsoft.VisualStudio.Tools.Applications.ServerDocument.v10.0/10.0.0.0__b03f5f7f11d50a3a/Microsoft.VisualStudio.Tools.Applications.ServerDocument.v10.0.dll
    ----------------------------------------
    Microsoft.VisualStudio.Tools.Applications.Runtime.v9.0
        Assembly Version: 9.0.0.0
        Win32 Version: 9.0.30729.4130
        CodeBase: file:///C:/Windows/assembly/GAC_MSIL/Microsoft.VisualStudio.Tools.Applications.Runtime.v9.0/9.0.0.0__b03f5f7f11d50a3a/Microsoft.VisualStudio.Tools.Applications.Runtime.v9.0.dll
    ----------------------------------------
    System.Windows.Forms
        Assembly Version: 2.0.0.0
        Win32 Version: 2.0.50727.4927 (NetFXspW7.050727-4900)
        CodeBase: file:///C:/Windows/assembly/GAC_MSIL/System.Windows.Forms/2.0.0.0__b77a5c561934e089/System.Windows.Forms.dll
    ----------------------------------------
    System.Drawing
        Assembly Version: 2.0.0.0
        Win32 Version: 2.0.50727.4927 (NetFXspW7.050727-4900)
        CodeBase: file:///C:/Windows/assembly/GAC_MSIL/System.Drawing/2.0.0.0__b03f5f7f11d50a3a/System.Drawing.dll
    ----------------------------------------
    System.Deployment
        Assembly Version: 2.0.0.0
        Win32 Version: 2.0.50727.4927 (NetFXspW7.050727-4900)
        CodeBase: file:///C:/Windows/assembly/GAC_MSIL/System.Deployment/2.0.0.0__b03f5f7f11d50a3a/System.Deployment.dll
    ----------------------------------------
    System.Configuration
        Assembly Version: 2.0.0.0
        Win32 Version: 2.0.50727.4927 (NetFXspW7.050727-4900)
        CodeBase: file:///C:/Windows/assembly/GAC_MSIL/System.Configuration/2.0.0.0__b03f5f7f11d50a3a/System.Configuration.dll
    ----------------------------------------
    System.Xml
        Assembly Version: 2.0.0.0
        Win32 Version: 2.0.50727.4927 (NetFXspW7.050727-4900)
        CodeBase: file:///C:/Windows/assembly/GAC_MSIL/System.Xml/2.0.0.0__b77a5c561934e089/System.Xml.dll
    ----------------------------------------
    System.Security
        Assembly Version: 2.0.0.0
        Win32 Version: 2.0.50727.4951 (win7RTMGDR.050727-4900)
        CodeBase: file:///C:/Windows/assembly/GAC_MSIL/System.Security/2.0.0.0__b03f5f7f11d50a3a/System.Security.dll
    ----------------------------------------
    System.Xml.Linq
        Assembly Version: 3.5.0.0
        Win32 Version: 3.5.30729.4926 built by: NetFXw7
        CodeBase: file:///C:/Windows/assembly/GAC_MSIL/System.Xml.Linq/3.5.0.0__b77a5c561934e089/System.Xml.Linq.dll
    ----------------------------------------
    System.AddIn.Contract
        Assembly Version: 2.0.0.0
        Win32 Version: 3.5.30729.4926 built by: NetFXw7
        CodeBase: file:///C:/Windows/assembly/GAC_MSIL/System.AddIn.Contract/2.0.0.0__b03f5f7f11d50a3a/System.AddIn.Contract.dll
    ----------------------------------------

    This is what I have in the application manifest:

      <vstav2:addIn xmlns:vstav2="urn:schemas-microsoft-com:vsta.v2">
        <vstav2:entryPoints>
          <vstav2:entryPoint class="MyApplication.ThisAddIn">
            <assemblyIdentity name="MyApplication" version="9.0.0.0" language="neutral" processorArchitecture="msil" />
          </vstav2:entryPoint>
        </vstav2:entryPoints>
        <vstav2:update enabled="true">
          <vstav2:expiration maximumAge="7" unit="days" />
        </vstav2:update>
        <vstav2:application>
          <vstov3:customization xmlns:vstov3="urn:schemas-microsoft-com:vsto.v3">
            <vstov3:appAddIn application="Outlook" loadBehavior="3" keyName="MyApplication">
              <vstov3:friendlyName>MyApplication</vstov3:friendlyName>
              <vstov3:description>MyApplication- Outlook add-in created with Visual Studio Tools for Office</vstov3:description>
            </vstov3:appAddIn>
          </vstov3:customization>
        </vstav2:application>
      </vstav2:addIn>

     

    My question is: Is there anything specific I need to do in the above XML to point to the VSTO SE 2005 DLL?

     

    Your help will be greatly appreciated.

     

    Thank you,

    Rajat

    Thursday, March 31, 2011 5:15 PM

All replies

  • Hi rbshrestha,

    Thanks for posting in the MSDN Forum.

    Try to add this snippet at the head of your xml.

    <entryPoint>
      <co.v1:customHostSpecified />
    </entryPoint> 
    
    

    I hope it helps.

    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.

    Monday, April 4, 2011 5:37 AM
    Moderator
  • Hi Tom,

    I do have the "entryPoint" element in the head of my xml. The problem I'm running into is that the add-in loads fine if I used the DLL that was generated using VS2008 and VSTO 3.0. However, if i replace it with the DLL that was generated using the VS2005 VSTO SE, it throws this exception:

     

    Microsoft.VisualStudio.Tools.Applications.Runtime.CannotCreateCustomizationDomainException: Customization could not be loaded because the application domain could not be created. ---> System.ArgumentException: The type "MyApplication.ThisAddIn" could not be found in assembly "c:\dev\MyApplication.dll"

     

    My question is whether there is anything that needs to be changed in the XML to use the older DLL version?

     

    Your help is and will be greatly appreciated.

    Thank you,

    Rajat

     

    Tuesday, April 5, 2011 6:35 PM
  • Hi Rajat,

     

    Do you ensure the VSTO 3.0 is installed?

     

    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, April 6, 2011 9:45 AM
    Moderator
  • Hi Tom,

    I do not have the VSTO 3.0 installed but I do have the VSTO SE installed. The add-in works as long as I use the DLL that was generated using the VSTO 3.0 and VS2008. It breaks only if i replace it with an older DLL. The whole point of replacing the DLL is to use the VSTO SE and so that we don't have to use the VSTO 3.0 in the end-users computer.

     

    So are you saying that if i install VSTO 3.0, then replacing the older DLL with the same application manifest should work without any problem? Could you explain in little detail.

    Thank you,

    Rajat


    P.S: I installed VSTO 3.0 and I still get the same error when i replace it with my older DLL.
    Wednesday, April 6, 2011 1:38 PM
  • Rajat,

    i can see that you've renamed the namespaces in the application manifest file to be more like VSTO 2005 SE, but in actuality, there is very little in common between the VSTO 3.0 runtime and the VSTO 2005 SE runtime.

    some differences: the VSTO 3.0 runtime uses ClickOnce to secure, deploy, install, and load add-ins. the VSTO 2005 SE runtime does not; it uses the System.Addin namespace to load add-ins and it used Windows Installer (MSI). the registry keys for add-ins that target the VSTO 3.0 runtime point to the deployment manifest for the add-in, but the registry keys for add-ins that target the VSTO 2005 SE runtime point to the application manifest.

    in addition, your VM actually has the VSTO 2010 runtime installed on it, not the VSTO 2005 SE runtime on it.  the Microsoft.VisualStudio.Tools.Applications.Runtime.v10.0 file (and all the other v10.0 files) indicate this.

    in short, you have to create a brand-new installer if you change the version of the VSTO runtime. take a look at the Deploying Office Solutions to End User Computers sticky in this forum for pointers about the VSTO 2005 SE runtime, documentation, and MSI code samples.

    if you actually want to install your add-in on top of the the VSTO 2010 runtime, you don't need to make any changes in the XML from your VSTO 3.0 runtime. it should just work. 

    m.

    Friday, April 8, 2011 8:30 PM
    Moderator
  • Mary,

    Thanks  for your response. It sounds like I will not be able to achieve what I intended because of differences in addin loading pattern between VSTO 3.0 and VSTO 2.0. The whole point of this was to avoid having my clients upgrade to .NET 3.5 and have the same add-in work in 64 bit Outlook 2010. Plus, .NET 3.5 redistributable file is over 200 MB.

    Please let me know if you think of any work around that will allow me to still use the VSTO 2.0 DLLS in 64bit Outlook 2010 (I'm aware of the documentation that states VSTO 3.0 targeted to Outlook 2007 Addin as required components for 64-bit Outlook that requires ClickOnce deployment) .

    Thanks again!

    Rajat

    Monday, April 18, 2011 3:01 PM
  • Rajat,

    there is no workaround for running the VSTO 2005 SE assemblies in Microsoft Office 2010 64-bit. see Visual Studio Tools for Office Runtime Overview.

    The 64-bit version of Microsoft Office 2010 can also run Office solutions that were created by using project templates for the 2007 Microsoft Office system in Visual Studio 2008. However, it cannot run Office solutions created by using project templates for Microsoft Office 2003 in Visual Studio 2008, or Office solutions created by using Visual Studio 2005. For more information, see Running Solutions in Different Versions of Microsoft Office.

    however, you can re-examine your statement about redistributing the .NET Framework. if your clients are using Windows 7 SP1, the .NET Framework 3.5 SP1 is already included in the OS; it just needs to be enabled. in addition, if your clients have Microsoft 2010 installed, the VSTO runtime is also already installed. if your clients are not using Windows 7, you can choose to include the .NET Framework Client Profile, a smaller subset of the .NET Framework. see .NET Framework Client Profile.

    m.

    Monday, April 18, 2011 5:20 PM
    Moderator