Question:

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 Assembly1.dll into the current application domain. Which code segment should you use?

 

A AppDomain= domain = AppDomain::CurrentDomain;
String= myPath = Path::Combine(domain->BaseDirectory, "Assembly1.dll");
Assembly= assm = Assembly::LoadFrom(myPath); 

B AppDomain= domain = AppDomain::CurrentDomain;
String= myPath = Path::Combine(domain->BaseDirectory, "Assembly1.dll");
Assembly= assm = Assembly::Load(myPath); 

C AppDomain= domain = AppDomain::CurrentDomain;
String= myPath = Path::Combine(domain->DynamicDirectory, "Assembly1.dll");
Assembly= assm = AppDomain::CurrentDomain::Load(myPath); 

D AppDomain= domain = AppDomain::CurrentDomain;
Assembly= assm = domain->GetData("Assembly1.dll"); 

+ Answer
+ Report
Total Preview: 813

Copyright © 2024. Powered by Intellect Software Ltd