[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

microsoft.public.dotnet.framework

Evidence of referenced assemblis is not inherited with Assembly.LoadFrom

Mikhail

8/27/2008 3:56:00 AM

Hello,

I have 2 assemblies A1 and A2. The A2 depends on (references) A1. When I do:

Evidence ev = new Evidence(new object[] { new Url(@\\myhost\myshare), new
Zone(SecurityZone.MyComputer) }, new object[] { });
Assembly A1 = Assembly.LoadFrom(assembly1Path, ev);

And then use any method in A1 all works fine. However if I do:

Assembly A2 = Assembly.LoadFrom(assembly2Path, ev);

before I load A1, then I start getting security exceptions when some methods
in A2 call methods in A1.
I believe the problem is that when A2 is loaded with the proper evidence the
same evidence is not used to load its dependancies (A1).

How do I make the framework load all referenced from A2 assemblies with the
evidence which I specify for loading A2 itself?

//Misha