You are developing an application that dynamically loads assemblies from an application directory. You need to write a code segment that loads an assembly named Braindumps1.dll into the current application domain. Which code segment should you use?

You are developing an application that dynamically loads assemblies from an application
directory.
You need to write a code segment that loads an assembly named Braindumps1.dll into the
current application domain. Which code segment should you use?


A. AppDomain domain = AppDomain.CurrentDomain;string myPath =
    Path.Combine(domain.BaseDirectory,
    “Braindumps1.dll”);Assembly asm = Assembly.LoadFrom(myPath);
B. AppDomain domain = AppDomain.CurrentDomain;string myPath =
    Path.Combine(domain.BaseDirectory,
    “Braindumps1.dll”);Assembly asm = Assembly.Load(myPath);
C. AppDomain domain = AppDomain.CurrentDomain;string myPath =     
    Path.Combine(domain.DynamicDirectory, “Braindumps1.dll”);Assembly asm =  
    AppDomain.CurrentDomain.Load(myPath);
D. AppDomain domain = AppDomain.CurrentDomain;Assembly asm =     
    domain.GetData(“Braindumps1.dll”);

Answer: A 

No comments:

Post a Comment