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);
The correct answer would be B! As stated on the MSDN: “You cannot execute code from an assembly loaded into the reflection-only context. To execute code, the assembly must be loaded into the execution context as well, using the Load method.” (https://msdn.microsoft.com/en-us/library/h55she1h(v=vs.110).aspx#Anchor_2)
3
0
I think it is B
A excluded : ReflectionOnlyLoadFrom(string assemblyFile)
@see https://msdn.microsoft.com/en-us/library/system.reflection.assembly.reflectiononlyloadfrom(v=vs.110).aspx
3
0
Yes B is correct.
2
0
But look carefully “B) case” : Assembly.ReflectionOniyLoad(bytes) – “i” instead “l” , i think it’s not a mistake from test I think it’s wrong answer;
1
0
With C you would violate “but the code must be denied access from executing code from the assembly”
1
0
B jak Baran Bill
0
0