DefaultDependencyAttribute(LoadHint) Costruttore

Definizione

Inizializza una nuova istanza della DefaultDependencyAttribute classe con l'associazione specificata LoadHint .

public:
 DefaultDependencyAttribute(System::Runtime::CompilerServices::LoadHint loadHintArgument);
public DefaultDependencyAttribute(System.Runtime.CompilerServices.LoadHint loadHintArgument);
new System.Runtime.CompilerServices.DefaultDependencyAttribute : System.Runtime.CompilerServices.LoadHint -> System.Runtime.CompilerServices.DefaultDependencyAttribute
Public Sub New (loadHintArgument As LoadHint)

Parametri

loadHintArgument
LoadHint

Uno dei LoadHint valori che indica la preferenza di associazione predefinita.

Esempio

Nell'esempio di codice seguente viene illustrato come applicare l'attributo DefaultDependencyAttribute a un assembly per specificare che è probabile che la dipendenza venga caricata.

using System;
using System.Runtime.CompilerServices;

[assembly: DefaultDependencyAttribute(LoadHint.Always)]
class Program
{

    static void Main(string[] args)
    {

        Console.WriteLine("The DefaultDependencyAttribute attribute was applied.");
    }
}
Imports System.Runtime.CompilerServices

<Assembly: DefaultDependencyAttribute(LoadHint.Always)> 
Module Program


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


End Module

Si applica a