Understanding Reflection and Security

Suppose you downloaded some code from the Internet. If any of that code could poke around on your system, load any assembly, and perform any operation, then .NET would be problematic indeed. However, instead of opening security holes, Microsoft has advertised that security risks have been diminished by the security model introduced in .NET.

Chapter 18 goes into security at length, so I will refer you to that chapter for the complete picture. In general, code must be granted ReflectionPermission to obtain information about nonpublic members. Without ReflectionPermission code can obtain information about public types and members; enumerate types, modules, and assemblies; and invoke public members.

You might ...

Get Visual Basic® .NET Power Coding now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.