O'Reilly logo

Microsoft® Visual Basic® .NET Programmer's Cookbook by Matthew MacDonald

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Determine the Evidence Associated with an Assembly

Problem

You want to determine the evidence that the .NET security infrastructure uses to determine the permissions of a piece of code.

Solution

Create a System.Reflection.Assembly object, and walk through all the items in the Evidence collection.

Discussion

It’s often useful to be able to read the evidence that .NET attaches to an assembly. This is particularly important when debugging code access security settings with a distributed application that uses reflection to load assemblies from the Internet. (See recipe Load an Assembly from a Remote Location for a specific example.)

You can retrieve the evidence for any assembly through the Assembly.Evidence property. This property returns a System.Security.Policy.Evidence ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required