What should you do?

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 system utility application and are required to write some code that allows you to examine assemblies compiled for other platforms of the .NET Framework. You create a new application domain and load assemblies into it.
You are required to ensure that code loaded into this context can be examined but not executed.
You know the path name of the file containing the assembly but you do not know the name of the assembly.
What should you do?

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 system utility application and are required to write some code that allows you to examine assemblies compiled for other platforms of the .NET Framework. You create a new application domain and load assemblies into it.
You are required to ensure that code loaded into this context can be examined but not executed.
You know the path name of the file containing the assembly but you do not know the name of the assembly.
What should you do?

A.
The Assembly.ReflectionOnlyLoadFrom method should be used.

B.
The Assembly.LoadFrom method should be used.

C.
The Assembly.ReflectionOnlyLoad method should be used.

D.
The Assembly.Load method should have been used.

Explanation:
The correct method for what is required would be to use the reflection-only load context because this allows you to only examine the assembly and not execute it.
Incorrect Answers:
B, D: These methods should not be considered for usage because the methods allow you to execute code and create objects.
C: The method in question should not be considered for usage when you only know the path name to where the assembly resides.



Leave a Reply 1

Your email address will not be published. Required fields are marked *


networkmanagers

networkmanagers

I have the same idea. A