Re: Loading assemblies from another AppDomain

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



Unfortunately this won't help. Private bin path can't lie outside the
application base, i.e. it's just a hint to searh in other sub-directories.
It can't be set to any other directory on the machine.

Vagif


"Gunter Prossliner" <gpointprossliner@xxxxxxxxxxxx> wrote in message
news:A161CD49-3BA7-4452-8EDB-0F9782535B63@xxxxxxxxxxxxxxxx
> Hi Vagif!
>
>> My application creates an AppDomain and sets is base directory outside
>> the
>> directory of the creator. Then it needs to load in a newly created domain
>> an
>> assembly that is installed in the original (creator) domain. And fails,
>> of
>> coures, because new domain does not have this directory in it's probing
>> path.
>
> Have you checked the PrivateBinPath / PrivateBinPathProbe Properties from
> the AppDomainSetup class?
>
> // Set up the AppDomainSetup
> AppDomainSetup setup = new AppDomainSetup();
> setup.ApplicationBase = "(some directory)";
> setup.PrivateBinPathProbe = "(probe directory)";
>
> // Set up the Evidence
> Evidence baseEvidence = AppDomain.CurrentDomain.Evidence;
> Evidence evidence = new Evidence(baseEvidence);
> evidence.AddAssembly("(some assembly)");
> evidence.AddHost("(some host)");
>
> // Create the AppDomain
> AppDomain newDomain = AppDomain.CreateDomain("newDomain", evidence,
> setup);
>
>
> OK?
> br, GP


.



Relevant Pages

  • Re: Appdomain.CreateDomain throws SecurityException
    ... > Exception. ... > at System.AppDomain.nCreateDomain(String friendlyName, AppDomainSetup ... > setup, Evidence providedSecurityInfo, Evidence creatorsSecurityInfo, ...
    (microsoft.public.dotnet.security)
  • Re: Appdomain.CreateDomain throws SecurityException
    ... Follwoing is the code that generates this exception ... >> setup, Evidence providedSecurityInfo, Evidence creatorsSecurityInfo, ... >> Evidence securityInfo, AppDomainSetup appDomainInfo) ...
    (microsoft.public.dotnet.security)
  • RE: Loading assemblies from another AppDomain
    ... > assembly that is installed in the original (creator) domain. ... Have you checked the PrivateBinPath / PrivateBinPathProbe Properties from ... // Set up the AppDomainSetup ... Evidence baseEvidence = AppDomain.CurrentDomain.Evidence; ...
    (microsoft.public.dotnet.framework.clr)