Controlling how P/Invoked assemblies are loaded into different app domains
问题 I've got an application which needs to call some unmanaged code in a dll. I need to do these calls from multiple app domains and specifically want the assembly to be loaded into memory multiple times (once per app domain). I've tried doing the following: Dim AppDomainSetup As New AppDomainSetup With AppDomainSetup .PrivateBinPath = "<Blah>" .LoaderOptimization = LoaderOptimization.MultiDomainHost End With Dim AppDomain As AppDomain = AppDomain.CreateDomain(String.Format("AppDomain-{0}",