DefaultDependencyAttribute(LoadHint) 构造函数
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
用指定的 DefaultDependencyAttribute 绑定初始化 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)
参数
示例
下面的代码示例演示如何将 特性应用于 DefaultDependencyAttribute 程序集,以指定可能加载依赖项。
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