1

İ am sorry it is too classic problem loading dll. But i can not solve this basic problem: i have a plugins file path i want to load these assembly into new domain but i can not do this. Firstly; it is a web application my code below: thanks your help :



     foreach (var filePath in arryFiles)
                {
                    Assembly asm = Assembly.LoadFile(filePath.ToString());
                    AppDomainSetup domainSetup = new AppDomainSetup();
                    domainSetup.ApplicationBase = AppDomain.CurrentDomain.BaseDirectory;
                    domainSetup.DisallowBindingRedirects = false;
                    domainSetup.DisallowCodeDownload = true;
                    domainSetup.LoaderOptimization = LoaderOptimization.SingleDomain;
                    domainSetup.ConfigurationFile = AppDomain.CurrentDomain.SetupInformation.ConfigurationFile;
                    ApplicationHost = AppDomain.CreateDomain("Ops.Mgr.Service", null, domainSetup);
                    // how to load into domain my assembly...

                }

Thanks your helps...

Bill the Lizard
  • 398,270
  • 210
  • 566
  • 880
loki
  • 2,926
  • 8
  • 62
  • 115

1 Answers1

2

Do you want to load assembly in to same App Domain or different App Domain?
Here is the solution to load assembly in different App Domain: Loading DLLs into a separate AppDomain

For loading assembly in same App Domain: Can I load a .NET assembly at runtime and instantiate a type knowing only the name?

Community
  • 1
  • 1
Falaque
  • 886
  • 2
  • 12
  • 27