Conditional APTCA

You can allow an assembly to be called by partially trusted code by applying the System.Security.AllowPartiallyTrustedCallers attribute at the assembly level. This can be accomplished as follows:

Imports System.Security<Assembly: AllowPartiallyTrustedCallers()>

Without this attribute, only full-trusted code can call the assembly. Different from versions prior to 4.0, in the .NET Framework 4.x this attribute no longer requires an assembly to be signed with a strong name, and its presence involves all the security functions present in the code in the security checks.

Get Visual Basic 2015 Unleashed 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.