Which code segment should you use?

Posted by: Pdfprep Category: 70-483 Tags: , ,

You are creating a console application by using C#.

You need to access the application assembly.

Which code segment should you use?
A . Assembly.GetAssembly(this);
B . this.GetType();
C . Assembly.Load();
D . Assembly.GetExecutingAssembly();

Answer: D

Explanation:

Assembly.GetExecutingAssembly – Gets the assembly that contains the code that is currently executing.

Reference: http://msdn.microsoft.com/en-us/library/system.reflection.assembly.getexecutingassembly(v=vs.110).aspx

Incorrect:

Not A: Assembly.GetAssembly – Gets the currently loaded assembly in which the specified class is defined.

http://msdn.microsoft.com/en-us/library/system.reflection.assembly.getassembly.aspx

Leave a Reply

Your email address will not be published.