You work as the application developer at Domain.com. Domain.com uses Visual Studio.NET 2005 as its application development platform.
You are developing a .NET Framework 2.0 application that uses the CreateDomain method of the AppDomain class to create an application domain.
You are required to set the following properties for the new application domain:
* Root directory
* Location of the configuration file
* Search path that the Common Language Runtime uses to load the assemblies into the domain
You must ensure that these properties values are passed to the CreateDomain method.
What should you do?
A.
Pass an AppDomainFactory object as a parameter to the CreateDomain method.
B.
Pass an AppDomainIsolatedTask object as a parameter to the CreateDomain method.
C.
Pass an AppDomainHelper object as a parameter to the CreateDomain method.
D.
Pass an AppDomainSetup object as a parameter to the CreateDomain method.
Explanation:
The correct method for achieving your scenario objective is to pass an AppDomainSetup object as parameter to the CreateDomain method. The AppDomainSetup object is used to allow you to specify the root directory and required.
Incorrect Answers:
A: This method is used to create a new AppDomain instance for the Web applications and can not be used to specify setup information for an application domain.
B: The method in question here can be used to create build tasks that can be instantiated in their own application domain but can not be used to specify setup information.
C: This method should not be used in the scenario as it switches into the given application domain and does a callback on the given function and can not be used to specify setup information.
I have the same idea. D