TypeProvider.AddAssemblyReference(String) Método

Definição

Adiciona uma referência ao Assembly para a lista interna.Adds a reference to the Assembly to the internal list. Este assembly é usado para a pesquisa de Type no método GetType(String).This assembly is used for the Type lookup in the GetType(String) method.

public:
 void AddAssemblyReference(System::String ^ path);
public void AddAssemblyReference (string path);
member this.AddAssemblyReference : string -> unit
Public Sub AddAssemblyReference (path As String)

Parâmetros

path
String

O caminho do Assembly a ser adicionado.The path of the Assembly to add.

Exceções

path é uma referência nula (Visual Basic Nothing).path is a null reference (Visual Basic Nothing).

Exemplos

O exemplo de código a seguir mostra como criar uma nova instância da TypeProvider classe e executar o AddAssemblyReference método.The following code example shows how to create a new instance of the TypeProvider class and run the AddAssemblyReference method. Este exemplo de código faz parte do exemplo do SDK do BasicDesignerHosting do arquivo WorkflowLoader.cs.This code example is part of the BasicDesignerHosting SDK Sample from the WorkflowLoader.cs file. Para obter mais informações, consulte Basic Designer Hosting.For more information, see Basic Designer Hosting.

TypeProvider typeProvider = new TypeProvider(host);
typeProvider.AddAssemblyReference(typeof(string).Assembly.Location);
Dim typeProvider As TypeProvider = New TypeProvider(host)
typeProvider.AddAssemblyReference(GetType(String).Assembly.Location)

Aplica-se a