none
Load Behavior: Not Loaded. A runtime error occurred during the loading of the COM Add-in

    Question

  • Hi,

    I am working on Outlook 2007 AddIn developed in VS2010 + .Net framework 4.0
    System Configuration is
    Windows 7 -32 bit
    Office 2010 32 -bit
     with .NET 4.0 ,3.5 and VS 2010.

    The Plug-In installtion is successful. But the Add-In is not added under the "Add-Ins" tab, but it is there under Active Application Add-ins at (File Options->Addins), 
    On selection of add-in at above location it's showing the follwing message.

    Load Behavior: Not Loaded. A runtime error occurred  during the loading of the COM Add-in.

    In the System Event Viwer the following exception is logged.

    Exception: <compatibleFrameworks xmlns="urn:schemas-microsoft-com:clickonce.v2">
      <framework targetVersion="4.0" profile="Full" supportedRuntime="4.0.30319" />
    </compatibleFrameworks>


    ************** Exception Text **************
    Microsoft.VisualStudio.Tools.Applications.Deployment.FrameworkVersionMismatchException: <compatibleFrameworks xmlns="urn:schemas-microsoft-com:clickonce.v2">
      <framework targetVersion="4.0" profile="Full" supportedRuntime="4.0.30319" />
    </compatibleFrameworks>
       at Microsoft.VisualStudio.Tools.Office.Runtime.SolutionInstaller.Install(ClickOnceAddInDeploymentManager clickOnceAddInDeploymentManager, OfficeAddInDeploymentManager officeDeploymentManager, AddInInformation& info)
       at Microsoft.VisualStudio.Tools.Office.Runtime.SolutionInstaller.ProcessInstallerOperation(ClickOnceAddInDeploymentManager clickOnceAddInDeploymentManager, OfficeAddInDeploymentManager officeAddInDeploymentManager, AddInInformation& info)
       at Microsoft.VisualStudio.Tools.Office.Runtime.SolutionInstaller.ProcessInstallerOperation(ClickOnceAddInDeploymentManager clickOnceAddInDeploymentManager, OfficeAddInDeploymentManager officeAddInDeploymentManager, Boolean showUIDuringDeployment)
       at Microsoft.VisualStudio.Tools.Office.Runtime.DomainCreator.CreateCustomizationDomainInternal(String solutionLocation, String manifestName, String documentName, Boolean showUIDuringDeployment, IntPtr hostServiceProvider, IntPtr& executor)


    ************** Loaded Assemblies **************
    mscorlib
        Assembly Version: 2.0.0.0
        Win32 Version: 2.0.50727.5420 (Win7SP1.050727-5400)
        CodeBase: file:///C:/Windows/Microsoft.NET/Framework/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.5420 (Win7SP1.050727-5400)
        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.5420 built by: Win7SP1
        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.5420 built by: Win7SP1
        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.5420 (Win7SP1.050727-5400)
        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.5420 (Win7SP1.050727-5400)
        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.5420 (Win7SP1.050727-5400)
        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.5420 (Win7SP1.050727-5400)
        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.5420 (Win7SP1.050727-5400)
        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.5420 (Win7SP1.050727-5400)
        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.5420 built by: Win7SP1
        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.5420 built by: Win7SP1
        CodeBase: file:///C:/Windows/assembly/GAC_MSIL/System.AddIn.Contract/2.0.0.0__b03f5f7f11d50a3a/System.AddIn.Contract.dll
    ----------------------------------------
    If anyone has any idea on this please help,

    Thanks

    Friday, August 24, 2012 10:19 AM

Answers

All replies

  • are you sure your add-in is compiled using .net 4.0? i see dlls from .net 3.5 listed. Show us screenshot of your project->properties->Application tab
    Friday, August 24, 2012 12:05 PM
  • The above error is shown in one dev machine and this one on another. The entire solution is a multitarget one with same project in 3.5 and 4.0 version. 4.0 is working proper only 3.5 is giving the error.

    <compatibleFrameworks xmlns="urn:schemas

    -microsoft-com:clickonce.v2">
      <framework targetVersion="3.5" profile="Client" supportedRuntime="2.0.50727" />
    </compatibleFrameworks>


    ************** Exception Text **************
    Microsoft.VisualStudio.Tools.Applications.Deployment.FrameworkVersionMismatchException: <compatibleFrameworks xmlns="urn:schemas-microsoft-com:clickonce.v2">
      <framework targetVersion="3.5" profile="Client" supportedRuntime="2.0.50727" />
    </compatibleFrameworks>
       at Microsoft.VisualStudio.Tools.Office.Runtime.SolutionInstaller.Install(ClickOnceAddInDeploymentManager clickOnceAddInDeploymentManager, OfficeAddInDeploymentManager officeDeploymentManager, AddInInformation& info)
       at Microsoft.VisualStudio.Tools.Office.Runtime.SolutionInstaller.ProcessInstallerOperation(ClickOnceAddInDeploymentManager clickOnceAddInDeploymentManager, OfficeAddInDeploymentManager officeAddInDeploymentManager, AddInInformation& info)
       at Microsoft.VisualStudio.Tools.Office.Runtime.SolutionInstaller.ProcessInstallerOperation(ClickOnceAddInDeploymentManager clickOnceAddInDeploymentManager, OfficeAddInDeploymentManager officeAddInDeploymentManager, Boolean showUIDuringDeployment)
       at Microsoft.VisualStudio.Tools.Office.Runtime.DomainCreator.CreateCustomizationDomainInternal(String solutionLocation, String manifestName, String documentName, Boolean showUIDuringDeployment, IntPtr hostServiceProvider, IntPtr& executor)


    ************** Loaded Assemblies **************
    mscorlib
        Assembly Version: 4.0.0.0
        Win32 Version: 4.0.30319.1 (RTMRel.030319-0100)
        CodeBase: file:///C:/WINDOWS/Microsoft.NET/Framework/v4.0.30319/mscorlib.dll
    ----------------------------------------
    Microsoft.VisualStudio.Tools.Office.Runtime
        Assembly Version: 10.0.0.0
        Win32 Version: 10.0.30319.1
        CodeBase: file:///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
    ----------------------------------------
    System.Core
        Assembly Version: 4.0.0.0
        Win32 Version: 4.0.30319.1 built by: RTMRel
        CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Core/v4.0_4.0.0.0__b77a5c561934e089/System.Core.dll
    ----------------------------------------
    System
        Assembly Version: 4.0.0.0
        Win32 Version: 4.0.30319.1 built by: RTMRel
        CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System/v4.0_4.0.0.0__b77a5c561934e089/System.dll
    ----------------------------------------
    Microsoft.VisualStudio.Tools.Applications.Hosting
        Assembly Version: 10.0.0.0
        Win32 Version: 10.0.30319.1
        CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/Microsoft.VisualStudio.Tools.Applications.Hosting/v4.0_10.0.0.0__b03f5f7f11d50a3a/Microsoft.VisualStudio.Tools.Applications.Hosting.dll
    ----------------------------------------
    Microsoft.VisualStudio.Tools.Applications.ServerDocument
        Assembly Version: 10.0.0.0
        Win32 Version: 10.0.30319.1
        CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/Microsoft.VisualStudio.Tools.Applications.ServerDocument/v4.0_10.0.0.0__b03f5f7f11d50a3a/Microsoft.VisualStudio.Tools.Applications.ServerDocument.dll
    ----------------------------------------
    Microsoft.VisualStudio.Tools.Applications.Runtime
        Assembly Version: 10.0.0.0
        Win32 Version: 10.0.30319.1
        CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/Microsoft.VisualStudio.Tools.Applications.Runtime/v4.0_10.0.0.0__b03f5f7f11d50a3a/Microsoft.VisualStudio.Tools.Applications.Runtime.dll
    ----------------------------------------
    System.Windows.Forms
        Assembly Version: 4.0.0.0
        Win32 Version: 4.0.30319.1 built by: RTMRel
        CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Windows.Forms/v4.0_4.0.0.0__b77a5c561934e089/System.Windows.Forms.dll
    ----------------------------------------
    System.Drawing
        Assembly Version: 4.0.0.0
        Win32 Version: 4.0.30319.1 built by: RTMRel
        CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Drawing/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Drawing.dll
    ----------------------------------------
    System.Deployment
        Assembly Version: 4.0.0.0
        Win32 Version: 4.0.30319.1 (RTMRel.030319-0100)
        CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Deployment/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Deployment.dll
    ----------------------------------------
    System.Configuration
        Assembly Version: 4.0.0.0
        Win32 Version: 4.0.30319.1 (RTMRel.030319-0100)
        CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Configuration/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Configuration.dll
    ----------------------------------------
    System.Xml
        Assembly Version: 4.0.0.0
        Win32 Version: 4.0.30319.1 built by: RTMRel
        CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Xml/v4.0_4.0.0.0__b77a5c561934e089/System.Xml.dll
    ----------------------------------------
    System.Security
        Assembly Version: 4.0.0.0
        Win32 Version: 4.0.30319.1 (RTMRel.030319-0100)
        CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Security/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Security.dll
    ----------------------------------------
    System.Xml.Linq
        Assembly Version: 4.0.0.0
        Win32 Version: 4.0.30319.1 built by: RTMRel
        CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Xml.Linq/v4.0_4.0.0.0__b77a5c561934e089/System.Xml.Linq.dll
    ----------------------------------------
    Microsoft.Office.Tools
        Assembly Version: 10.0.0.0
        Win32 Version: 10.0.30319.1
        CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/Microsoft.Office.Tools/v4.0_10.0.0.0__b03f5f7f11d50a3a/Microsoft.Office.Tools.dll
    ----------------------------------------

    This one seems wrong for obvious reasons 

    <framework targetVersion="3.5" profile="Client" supportedRuntime="2.0.50727" /> is trying to use v4.0 assemblies.

    But the first error ?

    <framework targetVersion="4.0" profile="Full" supportedRuntime="4.0.30319" />

    can use v2.0 assemblies right?

    • Edited by Jorge403001 Monday, August 27, 2012 10:25 AM
    Monday, August 27, 2012 9:20 AM
  • assemblies compiled for 4.0 and 3.5 do not mix so well in single process due to brakng changes in security and multiframework support starting with 4.0. I would try to load assemblies only from matching runtimes.
    Monday, August 27, 2012 2:40 PM
  • I am not explicitly mixing the dll's from 2 different frame work. The scenario is almost similar to this thread.

    http://social.msdn.microsoft.com/Forums/en-US/vsto/thread/29174df1-b856-4c39-94ec-46c84a44bcca/

    The issue is I am getting this as an alert when outlook is opened. I can't debug cause it's not even hitting the first System. Diagnostics.Debugger.Break() at ThisAddin_Startup().

    While putting break points in various static methods( which tentatively  hits) I got some more exception messages like

    Microsoft.VisualStudio.Tools.Applications.Runtime.CannotCreateCustomizationDomainException: Customization could not be loaded because the application domain could not be created.

    and

    System.Configuration.ConfigurationErrorsException

    Thanks 

    Thursday, August 30, 2012 9:08 AM
  • Hi All,At last I found the issue. The Problem was both my 3.5 and 4.0 framework projects have the same manifest name and in HKCU\Software/Microsoft\VSTO\SOlutionMetaData these same name cause the clr identification difficult.

    More info is on this thread(Which I overlooked early). 

    http://social.msdn.microsoft.com/Forums/en/vsto/thread/c595bb1e-79dc-412c-94f3-d7b1e8c9b449

    Monday, September 03, 2012 4:43 AM