Unfortunately, it looks like the called assembly is looking at the fact that
the addin, despite being strongly named, runs as an extension of Outlook ...
which is NOT managed code ... and decides that unmanaged code is not to be
trusted.
We ended up refactoring our addin ... it no longer calls the assembly that
demanded the full-trust caller.
It is frustrating that Outlook, in demanding that the addin run in
"full-trust" Code Access Security mode, is NOT trusted.
> I'm hitting this message as well, when trying to load one of my own
> assemblies from the outlook project (the assembly is strongly named).
[quoted text clipped - 20 lines]
> > Is there ANYTHING that can be done to make the CALLER, my addin, be
> > considered to be fully trusted???
Andy - 28 Jun 2006 20:44 GMT
Well, I don't think I'll be able to get around that restriction by
refactoring.
Did you have the oltloader.dll installed? (Or is it even needed?) I
don't have it installed (nor do I know how to) but I'd like to see if
this would help solve my problem.
Andy
> Unfortunately, it looks like the called assembly is looking at the fact that
> the addin, despite being strongly named, runs as an extension of Outlook ...
[quoted text clipped - 6 lines]
> It is frustrating that Outlook, in demanding that the addin run in
> "full-trust" Code Access Security mode, is NOT trusted.
mdpowers - 28 Jun 2006 21:30 GMT
I'm not sure what "OltLoader.dll" is. I have not run across it. We did find
that the AddinLoader.dll that ships with VSTO2005 is NOT signed; we ended up
signing it and then installing our copy to our installation folder.
Do you know which DLL is demanding the full-trust caller? In our case we
had to do some work to isolate which one it was; turns out it was in some UI
that we were able to move to a different process so that we are now OK.
You MAY be able to get around this if the assembly that is demanding the
full-trust callers can be updated to include the
"AllowPartiallyTrustedCallers" assembly attribute. In our case, it did not
work, but it may in yours. If you look up "AllowPartiallyTrustedCallers
Attribute" in the MSDN help, it will give you a list of NameSpaces that will
NOT allow partially trusted callers ... but ironically, my addin appears to
use a number of the ones on the list that do not allow partially trustd
callers, and yet works just fine.
> Well, I don't think I'll be able to get around that restriction by
> refactoring.
[quoted text clipped - 15 lines]
> > It is frustrating that Outlook, in demanding that the addin run in
> > "full-trust" Code Access Security mode, is NOT trusted.
Andy - 29 Jun 2006 13:27 GMT
Maybe that was the VSTO 2003 version of AddinLoader..
It turns out that my assembly WAS loading and actually executing some
code, but it was bombing when trying to get a section from a config
file which was handled by my own custom ConfigSectionHandler. The call
that bombed was the
System.Configuration.ConfigurationManager.GetSection; I guess for some
reason it couldn't get back into my already loaded assembly...
Adding the AllowTrustedPartialCallers did turn out to work, and
fortunatly I only needed to add it to the assembly which contained my
own ConfigurationManager / ConfigSectionHandler. All my other
assemblies seem to just operate with full trust (since they can access
AD, my database, etc.).
Thanks
Andy
> I'm not sure what "OltLoader.dll" is. I have not run across it. We did find
> that the AddinLoader.dll that ships with VSTO2005 is NOT signed; we ended up
[quoted text clipped - 12 lines]
> use a number of the ones on the list that do not allow partially trustd
> callers, and yet works just fine.