What is reflection?

Answer Posted / kirti

All .NET compilers produce metadata about the types defined in the modules they produce. This metadata is packaged along with the module (modules in turn are packaged together in assemblies), and can be accessed by a mechanism called reflection. The System.Reflection namespace contains classes that can be used to interrogate the types for a module/assembly.

Using reflection to access .NET metadata is very similar to using ITypeLib/ITypeInfo to access type library data in COM, and it is used for similar purposes - e.g. determining data type sizes for marshaling data across context/process/machine boundaries.

Reflection can also be used to dynamically invoke methods (see System.Type.InvokeMember ) , or even create types dynamically at run-time (see System.Reflection.Emit.TypeBuilder).

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

what is .edmx file and what it contains?

780


What are the versions of .net framework?

741


Are there any parts of the .net framework 3.0 that only work on windows vista?

806


What is the .net framework 3.0 (formerly winfx)?

730


Difference between ASP.NET MVC and ASP.NET WebForms?

784


What are sections?

785


What is net framework 3.0 ?

789


How can I return string result from action in asp.net mvc?

776


What is page life cycle?

694


What is objectcontext? : Entity framework

830


what is entityclient?

861


Explain the new features added in version 4 of mvc (mvc4)?

755


What is the significance of nonactionattribute?

744


What are the 2 ways of adding constraints to a route?

751


Is it possible to combine asp.net webforms and asp.mvc and develop a single web application?

737