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 Dim domain As AppDomain = AppDomain.CurrentDomain
Dim asm As [Assembly] = domain.GetData("Assembly1.dll") 

B Dim domain As AppDomain = AppDomain.CurrentDomain
Dim myPath As String = _
Path.Combine(domain.BaseDirectory, "Assembly1.dll")
Dim asm As [Assembly] = [Assembly].Load(myPath) 

C Dim domain As AppDomain = AppDomain.CurrentDomain
Dim myPath As String = _
Path.Combine(domain.BaseDirectory, "Assembly1.dll")
Dim asm As [Assembly] = [Assembly].LoadFrom(myPath) 

D Dim domain As AppDomain = AppDomain.CurrentDomain
Dim myPath As String = _
Path.Combine(domain.DynamicDirectory, "Assembly1.dll") Dim asm As [Assembly] = _ AppDomain.CurrentDomain.Load(myPath) 

+ Answer
+ Report
Total Preview: 767

Copyright © 2024. Powered by Intellect Software Ltd