none
Outlook Add-in Not Loaded :runtime error HELP HELP

    Question

  • Deall ALL,

    I installed the following in the client machine

    1. Office 2003 SP2
    2. framework 2.0
    3. office tools runtime
    4. MS PIA
    5. the Patch KB908002
    6. lockbackRegKey.msi
    7. extensibilityMSM.msi
    8. office2003-kb907417sfxcab-ENU.exe

    all did all of the above and no luck to get my Outlook- add in working in the destination machine

    BUT IT WORKING PEFECTLY in my DEVELOPMENT MACHINE

    plzzzzzzzzzzz help HELP

     

    Wednesday, August 2, 2006 3:59 PM

Answers

  • Hi

    Joe's link is a useful resource, you dont highlight how your application is being installed ? One of the main things is the registry keys for the HKEY_LOCAL_MACHINE\Software\Microsoft\Office\Outlook\Addins\youraddin.connect or the HKEY_CURRENT_USER equivelent, there is a load behavior setting that should be set to DWORD 3 and if this is 2 then there is a problem loading the stub.

    Another classic is the addin is black listed or another VSTO Addin has been installed and is blacklisted the complete VSTO Addin loader. To check load Outlook select Help About from the menus and select Disabled Items.. If there is an item in this list then that is your problem.

    Regards

    Wednesday, August 2, 2006 9:47 PM
    Moderator

All replies

  • Hussain,

    When you say it is working on your development machine, do you mean through the debugger only, or also through a full install on your machine?

    It sounds like it could be a CAS security problem.  See the post:
        http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=597337&SiteID=1 
    to give you a few more details.

    You can also get more information to why your addin failed (at least in Outlook 2003 with VSTO2005) if you start a cmd prompt and do the following:
        set VSTO_SUPPRESSDISPLAYALERTS=0

    Then run outlook from that cmd line generally from:
        c:\program files\Microsoft Office\Office11\Outlook.exe

    If your addin fails to load, it will give you a little more information on why.  I can help you more then.

    Cheers,
    ~Joe

    Wednesday, August 2, 2006 5:35 PM
  • Hi

    Joe's link is a useful resource, you dont highlight how your application is being installed ? One of the main things is the registry keys for the HKEY_LOCAL_MACHINE\Software\Microsoft\Office\Outlook\Addins\youraddin.connect or the HKEY_CURRENT_USER equivelent, there is a load behavior setting that should be set to DWORD 3 and if this is 2 then there is a problem loading the stub.

    Another classic is the addin is black listed or another VSTO Addin has been installed and is blacklisted the complete VSTO Addin loader. To check load Outlook select Help About from the menus and select Disabled Items.. If there is an item in this list then that is your problem.

    Regards

    Wednesday, August 2, 2006 9:47 PM
    Moderator
  •  

    I did the CAS but still the same. THE Add-in works smooth in My development machine. I meant if i start Addin in outlook (development machine) it will start up normally!!

    Its more than a week for this small project plzzzz help

    Thursday, August 3, 2006 6:57 AM
  • Hussain,

    Are you seeing any errors when starting Outlook from the command line with the environment variable set (as I mentioned above)?  What is the error?

    Also, make sure the add-in is not disabled as in the previous post.

    Cheers,
    ~Joe

    Thursday, August 3, 2006 7:01 AM
  • NO ERRORs at all
    Thursday, August 3, 2006 7:02 AM
  • It's not disabled plus here is the error message under outlook

    "LoadBehavior: Not Loaded. A runtime error occured during the loading of the COM Add-in

    Thursday, August 3, 2006 7:04 AM
  • Okay, do the following:

    1. Verify that the add-in is not disabled in the registry (I presume you install it to HKCU)
        HKCU->Software->Microsoft->Office->Outlook->Addins->NAME
        The LoadBehavior key should be 3.  If it is anything else, change it to 3.

    2. Start a cmd prompt.

    3. type:  set VSTO_SUPPRESSDISPLAYALERTS=0

    4. Launch Outlook from the command line shell (so that the environment variable is set).

    5. During startup, you should get a UI box that pops up with some debug info about why it is failing to load.

    6. Copy the error text from that box to the post here so we can help you further.

    Cheers,
    ~Joe

     

    Thursday, August 3, 2006 7:12 AM
  • Joe,

     

    LoadBehavior key = 3

    so that means its not disabled plus i did step number 3

    i got the same erro msg "LoadBehavior: Not Loaded. A runtime error occured during the loading of the COM Add-in"

     

     

    Thursday, August 3, 2006 7:20 AM
  • Ohhh I noticed the LoadBehavior is changing to 2 now
    Thursday, August 3, 2006 7:21 AM
  • This just means that the addin is disabled since it failed loading for some reason.

    Honestly, I am at a loss here.  I don't know how to help you without more info in the error window that pops up.  Hopefully someone else has an idea.

    My Apologies,
    ~Joe

    Thursday, August 3, 2006 7:38 AM
  • there is no window pop up!!!
    Thursday, August 3, 2006 7:40 AM
  • I can only point you further to: http://msdn2.microsoft.com/en-us/library/ms269003.aspx

    ~Joe

    Thursday, August 3, 2006 7:43 AM
  • I forgot to say that im using Outlook 2003 with SP2 .

    IS THAT WILL CAUSE ME A PROLEM??

    SHALL I TRY WITH SP1????

    Thursday, August 3, 2006 5:46 PM
  • Have the same problem. The popup window says:

     The current .Net security policy  does not permit the customization to run ....

    Could not load file or assembly 'OutlookAddin1, Version=1.0.0.0, Culture=neutral, PublicKey Token=..........'

    Failed to grant permission to execute.

    Friday, August 18, 2006 1:13 PM
  • You should probably start a new thread on this...

    However, follow the links in my above post, and make sure that the CAS security policy is set correctly.

    Cheers,
    ~Joe

    Friday, August 18, 2006 6:28 PM
  • Thank you. The problem is solved. There was an incorrect CAS settings.
    Friday, August 18, 2006 8:29 PM
  • I've seen a few posts with alot of people having this same problem but with no good complete answer.  I had the same problem and what everyone fails to mention about the cas is this.

    You must use the the .net 2.0 configuration manager found on the .net 2.0 redistibutable SDK.  This is a 350MB download and install.  One doesn't come with the normal .net 2.0 redistibutable.  find this .msc and set the security and your fine.  Set to full trust and add your myaddin.dll to the assembly cache.

    or

    Use the gacutil.exe found on the 2.0 SDK.  The one that is found on the common .net 2.0 redistibutable doesn't work for addin.dll's for office.

    gacutil -i myaddin.dll

     

    Programming and distibution was a heck of alot easier in VB6.  Rapid Application Development has dissappeared in .Net.

    Thursday, September 7, 2006 7:25 PM
  • Dear All

    I have the same dam problem but when I open the outlook via command prompet the add-in load fine

    but when I open it direct in windows by windows menu the add-in show the same load error.

     

    any ideas any heeeeeeeeeeeeelp please 

    Thursday, March 1, 2007 4:01 PM
  •  

     

    Hi Joe,

    I have created a add in in vsto 2005 , and an installer , according to steps given in msdn .

    Installer is running successfully on client machine , but add in is not effective on client.

    Perhaps ,in  tools>>options>>other>>com add-ins  an error message is displayed ,if I check the check box in front of my add-in.

     

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

     

    I read your all blogs, and did whatever you have written , yet not getting success.

     

    Thanks

    Gunwant

     

    Friday, April 20, 2007 6:38 AM
  • Hi joe

    i did the same thing as you mentioned to Hussen , i got a popup message box containing this error message

     

    error Message:::::>

     

    Could not load file or assembly 'MyInstaller, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. Failed to grant permission to execute. (Exception from HRESULT: 0x80131418)


    ************** Exception Text **************
    System.IO.FileLoadException: Could not load file or assembly 'MyInstaller, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. Failed to grant permission to execute. (Exception from HRESULT: 0x80131418)
    File name: 'MyInstaller, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' ---> System.Security.Policy.PolicyException: Execution permission cannot be acquired.
       at System.Security.SecurityManager.ResolvePolicy(Evidence evidence, PermissionSet reqdPset, PermissionSet optPset, PermissionSet denyPset, PermissionSet& denied, Boolean checkExecutionPermission)
       at System.Security.SecurityManager.ResolvePolicy(Evidence evidence, PermissionSet reqdPset, PermissionSet optPset, PermissionSet denyPset, PermissionSet& denied, Int32& securitySpecialFlags, Boolean checkExecutionPermission)
       at Microsoft.VisualStudio.Tools.Applications.Runtime.AppDomainManagerInternal.HandleOnlineOffline(Exception e, String basePath, String filePath)
       at Microsoft.VisualStudio.Tools.Applications.Runtime.AppDomainManagerInternal.LoadStartupAssembly(EntryPoint entryPoint, Dependency dependency, Dictionary`2 assembliesHash)
       at Microsoft.VisualStudio.Tools.Applications.Runtime.AppDomainManagerInternal.ConfigureAppDomain()
       at Microsoft.VisualStudio.Tools.Applications.Runtime.AppDomainManagerInternal.LoadAssembliesAndConfigureAppDomain(IHostServiceProvider serviceProvider)
       at Microsoft.VisualStudio.Tools.Applications.Runtime.AppDomainManagerInternal.LoadEntryPointsHelper(IHostServiceProvider serviceProvider)

     


    ************** Loaded Assemblies **************
    mscorlib
        Assembly Version: 2.0.0.0
        Win32 Version: 2.0.50727.42 (RTM.050727-4200)
        CodeBase: file:///C:/WINDOWS/Microsoft.NET/Framework/v2.0.50727/mscorlib.dll
    ----------------------------------------
    Microsoft.VisualStudio.Tools.Applications.Runtime
        Assembly Version: 8.0.0.0
        Win32 Version: 8.0.50727.816
        CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/Microsoft.VisualStudio.Tools.Applications.Runtime/8.0.0.0__b03f5f7f11d50a3a/Microsoft.VisualStudio.Tools.Applications.Runtime.dll
    ----------------------------------------
    Microsoft.Office.Tools.Common
        Assembly Version: 8.0.0.0
        Win32 Version: 8.0.50727.816
        CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/Microsoft.Office.Tools.Common/8.0.0.0__b03f5f7f11d50a3a/Microsoft.Office.Tools.Common.dll
    ----------------------------------------
    System
        Assembly Version: 2.0.0.0
        Win32 Version: 2.0.50727.42 (RTM.050727-4200)
        CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System/2.0.0.0__b77a5c561934e089/System.dll
    ----------------------------------------
    System.Windows.Forms
        Assembly Version: 2.0.0.0
        Win32 Version: 2.0.50727.42 (RTM.050727-4200)
        CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Windows.Forms/2.0.0.0__b77a5c561934e089/System.Windows.Forms.dll
    ----------------------------------------


     

    Friday, April 20, 2007 6:58 AM
  • Hi joe

     

    I changed the Load Behavior value to 3 , i came to knoeo one exception message box while starting outlook using command prompt.

     

     

    i did the same thing as you mentioned to Hussen , i got a popup message box containing this error message

     

    error Message:::::>

     

    Could not load file or assembly 'MyInstaller, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. Failed to grant permission to execute. (Exception from HRESULT: 0x80131418)


    ************** Exception Text **************
    System.IO.FileLoadException: Could not load file or assembly 'MyInstaller, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. Failed to grant permission to execute. (Exception from HRESULT: 0x80131418)
    File name: 'MyInstaller, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' ---> System.Security.Policy.PolicyException: Execution permission cannot be acquired.
       at System.Security.SecurityManager.ResolvePolicy(Evidence evidence, PermissionSet reqdPset, PermissionSet optPset, PermissionSet denyPset, PermissionSet& denied, Boolean checkExecutionPermission)
       at System.Security.SecurityManager.ResolvePolicy(Evidence evidence, PermissionSet reqdPset, PermissionSet optPset, PermissionSet denyPset, PermissionSet& denied, Int32& securitySpecialFlags, Boolean checkExecutionPermission)
       at Microsoft.VisualStudio.Tools.Applications.Runtime.AppDomainManagerInternal.HandleOnlineOffline(Exception e, String basePath, String filePath)
       at Microsoft.VisualStudio.Tools.Applications.Runtime.AppDomainManagerInternal.LoadStartupAssembly(EntryPoint entryPoint, Dependency dependency, Dictionary`2 assembliesHash)
       at Microsoft.VisualStudio.Tools.Applications.Runtime.AppDomainManagerInternal.ConfigureAppDomain()
       at Microsoft.VisualStudio.Tools.Applications.Runtime.AppDomainManagerInternal.LoadAssembliesAndConfigureAppDomain(IHostServiceProvider serviceProvider)
       at Microsoft.VisualStudio.Tools.Applications.Runtime.AppDomainManagerInternal.LoadEntryPointsHelper(IHostServiceProvider serviceProvider)

     


    ************** Loaded Assemblies **************
    mscorlib
        Assembly Version: 2.0.0.0
        Win32 Version: 2.0.50727.42 (RTM.050727-4200)
        CodeBase: file:///C:/WINDOWS/Microsoft.NET/Framework/v2.0.50727/mscorlib.dll
    ----------------------------------------
    Microsoft.VisualStudio.Tools.Applications.Runtime
        Assembly Version: 8.0.0.0
        Win32 Version: 8.0.50727.816
        CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/Microsoft.VisualStudio.Tools.Applications.Runtime/8.0.0.0__b03f5f7f11d50a3a/Microsoft.VisualStudio.Tools.Applications.Runtime.dll
    ----------------------------------------
    Microsoft.Office.Tools.Common
        Assembly Version: 8.0.0.0
        Win32 Version: 8.0.50727.816
        CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/Microsoft.Office.Tools.Common/8.0.0.0__b03f5f7f11d50a3a/Microsoft.Office.Tools.Common.dll
    ----------------------------------------
    System
        Assembly Version: 2.0.0.0
        Win32 Version: 2.0.50727.42 (RTM.050727-4200)
        CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System/2.0.0.0__b77a5c561934e089/System.dll
    ----------------------------------------
    System.Windows.Forms
        Assembly Version: 2.0.0.0
        Win32 Version: 2.0.50727.42 (RTM.050727-4200)
        CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Windows.Forms/2.0.0.0__b77a5c561934e089/System.Windows.Forms.dll
    ----------------------------------------


     

    Friday, April 20, 2007 7:08 AM
  • There is a fix for Office that helps in loading VSTO and .NET Based addins.. the kb is http://support.microsoft.com/?kbid=907417 this may help. Additional reinstall the Office PIA's and then this patch

     

    Regards

    Friday, April 20, 2007 7:17 AM
    Moderator
  • This is a Security Policy issue, the CAS needs to be configured to Grant Full Trust to this assembly and any other dependant assemblies you call upon in your solution. Please confirm how and what you have configured in the CAS through the .NET 2 Configuration tool from Admin Tools under control panel.

     

    9 out of 10 times this is the failing, the other is the registry keys are HKLM and not HKCU for Office 2007 Sad

     

    Regards

    Friday, April 20, 2007 7:21 AM
    Moderator
  • Hi Mike,

    I did some Security policy stuff explained as in following link.

     

    http://www.codeproject.com/dotnet/UB_CAS_NET.asp

     

     But the problen persist .

     

    Please help regarding CAS polocy.

     

     

    Thanks

    Friday, April 20, 2007 8:49 AM
  • Hussain,

     

       Did you fix your problem? I have the same problem. I set the LoadBehavior of my add-in to 3 and start outlook from command prompt. I dont see any UI or message explaining the problem.

    And i also noticed that LoadBehavior comes back to 2.

     

    I really appreciate any help on this... Struggling to get my add-in installer to work on machines other than my development machine. My installer works only on my development machine.

     

     

    Thanks in advance

    Kishore

    Friday, July 20, 2007 3:23 AM
  • Kishore,

     

    Are you doing this on Office 2003 or Office 2007? 


    ~Joe

    Friday, July 20, 2007 5:05 PM
  • Hi

    I am facing same problem

     

    My outlook add in is not loading in PC other than development PC.I tried all above points but still didn't succeed

     

    1) Load behaviour is remain 3 after open outlook

    2) In CAS add in has full trust rights

    3) There is no error while opening outlook from commnad prompt after execute command set VSTO_SUPPRESSDISPLAYALERTS=0

     

    All points that casue of error are OK but still not working

     

    Please help me

     

    Tuesday, October 23, 2007 11:07 AM
  • Hi Kishore

     

    Are you able to resolve the issue?

    I am getting the same issue in my Visio Add-in. Load behaviour is changing to 2 as the Visio Application loads.

     

    Please reply.

     

    Thanks

    Pooja

     

    Friday, February 8, 2008 6:21 AM

  • Ugly issue.

    There was a moment when I was looking for a fix for the fix so  I broke down and made the thingie in vs2003.

    It worked like a charm with debugger and all after I build and run the setup app with install path the same directory as my build folder.

    The more I get in touch with vs/office automation model the more sick I feel.


    Tuesday, February 19, 2008 12:37 PM
  • Did anyone Find an answer? I am still having this problem.
    Monday, January 12, 2009 8:38 PM
  • I guess, most of us are facing this issue...


    I wonder, why its is not caught and not solved.


    at my end, i have two outlook add-in, and i can only run of them.  :(
    - S K MISTRY
    Friday, June 12, 2009 4:29 AM
  • I have the same problem and tried everything said above but still got the error: "Not Loaded. A runtime error occured during the loading of the COM Add-in".

    I created a simple " Hello World" outlook 2003 add-in using VS 2008 on XP.   It just adds a tool bar on the outlook 2003 and when click the tool bar, it displays "Hello World" message box.   It works fine on the development PC but when I try to deploy it to a user PC with Admin privilege,  the add-in couldn't be loaded. 

    I used the installation setup project which it's created automatically when you select the outlook 2003 Add-in template to create the installation.

    After installed the add-in on the user's PC,  I used the caspol.exe to grant the fulltrust.

    caspol.exe  -m -af  "c:\program files\myapp\helloworldAddinSetup\HelloWorldAddin.dll"

    And also used the .Net Framework 2.0 Configuration to add the HelloWorldAddin.dll to the Assembly Cache and add the entry under Runtime Security Policy

    Nothing worked.

    Please Help!  Thanks.
    PJ
    Monday, October 5, 2009 8:16 PM