次の方法で共有


AllowPartiallyTrustedCallersAttribute クラス

厳密な名前付きのアセンブリを、部分的に信頼されているコードから呼び出すことができるようにします。この宣言がない場合、この種のアセンブリを使用できるのは、完全に信頼されている呼び出し元だけです。このクラスは継承できません。

この型のすべてのメンバの一覧については、AllowPartiallyTrustedCallersAttribute メンバ を参照してください。

System.Object
   System.Attribute
      System.Security.AllowPartiallyTrustedCallersAttribute

<AttributeUsage(AttributeTargets.Assembly)>
NotInheritable Public Class AllowPartiallyTrustedCallersAttribute   Inherits Attribute
[C#]
[AttributeUsage(AttributeTargets.Assembly)]
public sealed class AllowPartiallyTrustedCallersAttribute :   Attribute
[C++]
[AttributeUsage(AttributeTargets::Assembly)]
public __gc __sealed class AllowPartiallyTrustedCallersAttribute :   public Attribute
[JScript]
public
   AttributeUsage(AttributeTargets.Assembly)
class AllowPartiallyTrustedCallersAttribute extends   Attribute

スレッドセーフ

この型の public static (Visual Basicでは Shared) のすべてのメンバは、マルチスレッド操作で安全に使用できます。インスタンスのメンバの場合は、スレッドセーフであるとは限りません。

解説

AllowPartiallyTrustedCallersAttribute は、厳密な名前付きのアセンブリによってアセンブリ レベルで適用された場合にだけ有効です。アセンブリ レベルで属性を適用する方法の詳細については、「 属性の適用 」を参照してください。

既定では、部分的に信頼されたコードによる使用を許可するこの属性が、アセンブリ レベルで明示的に適用されていない厳密な名前付きのアセンブリは、セキュリティ ポリシーによって完全信頼が与えられている他のアセンブリからだけ呼び出すことができます。この制限は、アセンブリ内でパブリックにアクセス可能なすべてのクラスのすべてのパブリック メソッドと保護されているメソッドで FullTrustLinkDemand を使用することによって、強制的に適用されます。部分的に信頼されているコードから呼び出されることを想定しているアセンブリでは、 AllowPartiallyTrustedCallersAttribute を使用することによって、そのことを宣言できます。この属性は、アセンブリ レベルで宣言します。たとえば、C# の場合は、 [assembly:AllowPartiallyTrustedCallers] と宣言し、Visual Basic の場合は、 <assembly:AllowPartiallyTrustedCallers> と宣言します。

注意   アセンブリ レベルのこの属性が存在する場合、 FullTrustLinkDemand セキュリティ チェックを実行するという既定の動作は回避され、完全または部分的に信頼されているすべてのアセンブリは、このアセンブリを呼び出すことができます。

この属性が存在する場合、指定されているクラス レベルまたはモジュール レベルの宣言セキュリティ属性を含め、他のすべてのセキュリティ チェックはそのまま機能します。この属性によって、完全信頼の呼び出し元のみ暗黙的に許可する、ということはなくなります。

この属性は宣言セキュリティ属性ではありませんが、標準属性です。 SecurityAttribute ではなく Attribute から派生します。

詳細については、「 部分信頼コードからのライブラリの使用 」を参照してください。

必要条件

名前空間: System.Security

プラットフォーム: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 ファミリ

アセンブリ: Mscorlib (Mscorlib.dll 内)

参照

AllowPartiallyTrustedCallersAttribute メンバ | System.Security 名前空間