locked
ClickOnce Outlook 2007 Add-In (VSTO 3.0 / VS 2008 beta2) not loading on some systems RRS feed

  • Question

  • I'm developing an Add-In to Outlook 2007 using VSTO v 3.0 and Visual Studio Orcas beta 2 on Windows Vista. The Add-In is deployed with ClickOnce.

    The Add-In works perfectly on three of five computers:
    - My development computer (Vista, orcas beta2)
    - XP development computer (XP, VS2005)
    - Vista computer (Vista, no Visual Studio)

    The Add-In does install but does not load on the two other computers it has been tested on:
    - Both Vistas without any Visual Studio

    all five have VSTO runtime 3.0 and .NET framework 3.5 installed

    The only clue is an exception:

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

    I get the exception when I try to load the Add-In


    Any Ideas why I get this exception?
    Thanks in advance!

    -Christian

    Thursday, August 30, 2007 11:16 AM

Answers

  • I have now found a solution to my problem:

    I had two machines (out of five) that reported CannotCreateCustomizationDomainException. On one of these two I tested with repairing the VSTO 3.0 runtime installation (using Add and Remove Programs / Programs and Features), at the same time I also reinstalled my customization. This proved to do the trick and now the customization runs fine on the computer. I have yet to check if this also helps on the other problematic computer.

    Before I ran the repair tool of VSTOR 3.0 I cheked that _every_ Office program was closed, including Groove, just to be sure. I don't know if keeping the programs running makes any difference.

    Conclusion: The VSTOR 3.0 installer is buggy and does not install properly at all times, reinstall/repair helps.
    Friday, September 14, 2007 8:03 AM

All replies

  • I'm right there with you on the bleeding edge, Christian.  I don't actually have an answer for you, but I've run into a variation on the same problem today.  If we identify commonalities, perhaps we can help each other.

     

    I'm creating a Word document-based project with Visual Studio Orcas beta 2.  It works fine until I try to add a data layer project to the solution, which accesses a SQL Server Express db.  If I initialize a class in the data layer, there's no problem.  If I call a method that involves a database query, I see the exact same error that you do.  It's a non-starter.

     

    My initial hunch was that the problem involved the security context the app was running under and the Windows identity used to access the database. I tried switching the connection string to a neutral SQL login, but the problem remained.

     

    I then tried bringing the data access routines right into the Word document project.  Everything was exactly the same -- the connection string, the SQL tables accessed, the queries, the data objects, etc.  This time it worked.

     

    So.  It certainly looks like the error has something to do with creating an application domain in a separate dll.  Perhaps in your case, the different machines/application identities run with different levels of security and some do not permit accessing separate dlls.  I will let you know when I'm able to crack it, but please let me know if you crack it first. Smile

    Friday, August 31, 2007 11:35 PM
  • Thanks for the reply!

    Your suggestion that it might have to do with separate dlls does not seem to apply in my case.
    I tested with an VSTO 3.0 Outlook addin created from scratch that does nothing except for displaying a MessageBox when it loads. It installs through ClickOnce properly on the test computers but it does not load (with excactly the same exception message as earlier) on the "non working" computers.

    I can't think of anything else than configuration errors or some differences in the installed prerequisites. I just cant figure out where I should start digging for the solution.


    Thursday, September 6, 2007 8:05 AM
  • I did some research on this issue, not specifically related to VSTO/Orcas Beta 2.  It seems that error message “Appdomain could not be created…” is a fairly generic error any time .NET tries to create an appdomain but cannot.  It could be a missing file, or it could be a situation where an application identity is trying to open a dll file that exists, but the identity does not have the rights to the dll’s directory.


    The answer to my problem was pretty straightforward.  The data layer project was pulled from another solution.  Even though the project reference was established for the VSTO project, the physical path to the dll was not being resolved.  Hence, the appdomain could not be opened; it simply could not find the relevant dll.  When I created a new project within the same VSTO solution, the issue vanished.  I could have also solved it with the GAC, or manually copying the generated dll.


    For your case, I would start by comparing the app directories for each machine.  See if the dlls are being copied as part of the deployment.  If files are missing, it’s probably ClickOnce’s issue.  If they are present, you can start tracing the security contexts, or anything else you can think of that would prohibit a file from opening.

    Friday, September 7, 2007 2:16 AM
  • I have this same problem with an Outlook add-in created under VS2008/VSTO 3.0. Very mysterious why it works on some machines and not others.
    Installation reported success on each machine, but a few report CannotCreateCustomizationDomainException.

    Anyone make any progress in diagnosing this issue?

    Wednesday, September 12, 2007 11:02 PM
  • I have now found a solution to my problem:

    I had two machines (out of five) that reported CannotCreateCustomizationDomainException. On one of these two I tested with repairing the VSTO 3.0 runtime installation (using Add and Remove Programs / Programs and Features), at the same time I also reinstalled my customization. This proved to do the trick and now the customization runs fine on the computer. I have yet to check if this also helps on the other problematic computer.

    Before I ran the repair tool of VSTOR 3.0 I cheked that _every_ Office program was closed, including Groove, just to be sure. I don't know if keeping the programs running makes any difference.

    Conclusion: The VSTOR 3.0 installer is buggy and does not install properly at all times, reinstall/repair helps.
    Friday, September 14, 2007 8:03 AM
  • I also had the same problem mine occured when I instatiated an object that contained a background worker with an event in the constructor.

    Commented this out and the code works.

    So if you are using threading please check how or when you instatiate your objects.

    Friday, October 2, 2009 9:37 AM
  • I had the same problem, I had solved my problem By installing framework 3.5 sp pack1. after installation of frame work, I had uninstall my setup and then reinstalled, then it is working fine. 
    Friday, July 2, 2010 6:40 AM