I have created an HelloWorld-like Addin for Outlook,
which installed ok, both in development and on end-user machines,
but refused to load when starting Outlook. When I added the
Environment Variable "VSTO_LOGALERTS = 1" to my system, I got an error
log which told me that it failed because of code access security
reasons.
I then included an installer class based on
http://weblogs.asp.net/mnissen/archive/2005/07/01/417148.aspx
which adds a custom action to my setup project which sets the code access security for my addin.
Now the installation works well on workstations with development
environments, but when i try to run the installer in the user
environment, the installation fails with the following message:
Unable to get installer types in the <MyAddin.dll> assembly.
Unable to load one or more of the requested types.
Retrieve the LoaderExceptions property for more information.
So my questions are:
1. From where can I retrieve this LoaderExceptions property
2. Any good ideas to what I have done wrong
Thanks in advance
Anders Winthereik
Bankinvest
Denmark

Outlook Add-In Installation works only in developer environment
JHerington
Have you installed the prerequisitives:
(explained at http://msdn2.microsoft.com/en-us/library/2ac08ee2.aspx)
When only the user machines fail and not the development ones it sound like this kind of problem.
The LoaderExceptions property is probably this one, but Mads' code does not use reflection as far I know.
You could put a try-catch around this code an catch the ReflectionTypeLoadException and write exceptions to somewhere just to check that it isn't the installer (and if it is it may give additional information :-)
/Lars