DependencyAttribute クラスとは? わかりやすく解説

DependencyAttribute クラス

メモ : このクラスは、.NET Framework version 2.0新しく追加されたものです。

どのような場合参照アセンブリ依存関係読み込むかを示します。このクラス継承できません。

名前空間: System.Runtime.CompilerServices
アセンブリ: mscorlib (mscorlib.dll 内)
構文構文

<SerializableAttribute> _
<AttributeUsageAttribute(AttributeTargets.Assembly, AllowMultiple:=True)> _
Public NotInheritable Class
 DependencyAttribute
    Inherits Attribute
Dim instance As DependencyAttribute
[SerializableAttribute] 
[AttributeUsageAttribute(AttributeTargets.Assembly, AllowMultiple=true)]
 
public sealed class DependencyAttribute : Attribute
[SerializableAttribute] 
[AttributeUsageAttribute(AttributeTargets::Assembly, AllowMultiple=true)]
 
public ref class DependencyAttribute sealed
 : public Attribute
/** @attribute SerializableAttribute() */ 
/** @attribute AttributeUsageAttribute(AttributeTargets.Assembly, AllowMultiple=true)
 */ 
public final class DependencyAttribute extends
 Attribute
SerializableAttribute 
AttributeUsageAttribute(AttributeTargets.Assembly, AllowMultiple=true)
 
public final class DependencyAttribute extends
 Attribute
解説解説
使用例使用例

ネイティブ イメージ生成サービスを常に AssemblyAバインドし、場合によっては AssemblyBバインドするように指定するコード例次に示します

Imports System.Runtime.CompilerServices

<Assembly: DependencyAttribute("AssemblyA", LoadHint.Always)>
 
<Assembly: DependencyAttribute("AssemblyB", LoadHint.Sometimes)>
 
Module Program


    Sub Main(ByVal args() As
 String)
        Console.WriteLine("The DependencyAttribute attribute was
 applied.")
    End Sub


End Module
using System;
using System.Runtime.CompilerServices;

[assembly: DependencyAttribute("AssemblyA", LoadHint.Always)]
[assembly: DependencyAttribute("AssemblyB", LoadHint.Sometimes)]

class Program
{
    
    static void Main(string[]
 args)
    {

        Console.WriteLine("The DependencyAttribute attribute was applied.");

    }
}
継承階層継承階層
System.Object
   System.Attribute
    System.Runtime.CompilerServices.DependencyAttribute
スレッド セーフスレッド セーフ
この型の public static (Visual Basic では Shared) メンバはすべて、スレッド セーフです。インスタンス メンバ場合は、スレッド セーフであるとは限りません。
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照
関連項目
DependencyAttribute メンバ
System.Runtime.CompilerServices 名前空間
DefaultDependencyAttribute クラス
LoadHint
LoadHint



英和和英テキスト翻訳>> Weblio翻訳
英語⇒日本語日本語⇒英語
  

辞書ショートカット

すべての辞書の索引

「DependencyAttribute クラス」の関連用語

DependencyAttribute クラスのお隣キーワード
検索ランキング

   

英語⇒日本語
日本語⇒英語
   



DependencyAttribute クラスのページの著作権
Weblio 辞書 情報提供元は 参加元一覧 にて確認できます。

   
日本マイクロソフト株式会社日本マイクロソフト株式会社
© 2025 Microsoft.All rights reserved.

©2025 GRAS Group, Inc.RSS