Sharing a Library with Partially Trusted Code

This topic addresses the use of strong-named assemblies. The following information applies only to Level 1 assemblies or assemblies that use legacy security policy. Security-transparent code, level 2 assemblies in the .NET Framework version 4 or later are not affected by strong names. For more information about changes to the security system, see Security Changes in the .NET Framework 4. Several steps must be completed before shared libraries can be called by partially trusted code. For an overview of this issue, see Using Libraries from Partially Trusted Code. You can enable partially trusted access to your libraries by completing the three tasks described in the following sections.

Before your library can be shared through the global assembly cache or used as a downloaded component, you must create a strong name. Complete the following tasks described in Creating and Using Strong-Named Assemblies to assign a strong name to your library:

When this attribute is present, all other security checks in your code still work as before, including any class-level or method-level declarative security attributes that are present. This attribute blocks only the implicit LinkDemand enforcement.