Which code segment should you insert at line 04?

You are developing code for an application that retrieves information about Microsoft .NET Framework assemblies.
The following code segment is part of the application (line numbers are included for reference only):


You need to insert code at line 04. The code must load the assembly. Once the assembly is loaded, the code must be able to read the assembly metadata, but the code must be denied access from executing code from the assembly.
Which code segment should you insert at line 04?
A. Assembly.ReflectionOnlyLoadFrom(bytes);
B. Assembly.ReflectionOniyLoad(bytes);
C. Assembly.Load(bytes);
D. Assembly.LoadFrom(bytes);

microsoft-exams

2 thoughts on “Which code segment should you insert at line 04?

  1. B. Assembly.ReflectionOniyLoad(bytes);
    ReflectionOniyLoad: Loads an assembly into the reflection-only context, where it can be examined but not executed.

  2. When loading an assembly by using Load methor you are able to execute the code from the assembly, so you shall not use it. B is right answer.

Leave a Reply

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


The reCAPTCHA verification period has expired. Please reload the page.