Which code segment should you use?

You are creating a console application by using C#. You need to access the application assembly. Which code
segment should you use?

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();

Explanation:
Assembly.GetExecutingAssembly – Gets the assembly that contains the code that is currently executing.
http://msdn.microsoft.com/en-us/library/system.reflection.assembly.getexecutingassembly(v=vs.110).aspx
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 0

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