BuildManager.GetObjectFactory(String, Boolean) Método

Definição

Obtém um alocador de objeto para o caminho virtual especificado.Gets an object factory for the specified virtual path.

public:
 static System::Web::Util::IWebObjectFactory ^ GetObjectFactory(System::String ^ virtualPath, bool throwIfNotFound);
public static System.Web.Util.IWebObjectFactory GetObjectFactory (string virtualPath, bool throwIfNotFound);
static member GetObjectFactory : string * bool -> System.Web.Util.IWebObjectFactory
Public Shared Function GetObjectFactory (virtualPath As String, throwIfNotFound As Boolean) As IWebObjectFactory

Parâmetros

virtualPath
String

O caminho virtual.The virtual path.

throwIfNotFound
Boolean

true para gerar um erro se o caminho virtual não existir; caso contrário, false.true to throw an error if the virtual path does not exist; otherwise, false. Se o caminho virtual não existir e throwIfNotFound for false, esse método retornará null.If the virtual path does not exist and throwIfNotFound is false, this method returns null.

Retornos

IWebObjectFactory

A fábrica do objeto.The object factory.

Exceções

O caminho virtual não existe.The virtual path does not exist.

- ou --or-

Uma exceção de nível superior já existia quando este método foi chamado.A higher-level exception already existed when this method was called.

- ou --or-

Esse método foi chamado enquanto o processo de build estava compilando arquivos de nível superior.This method was called while the compilation process was building top-level files.

- ou --or-

Este é um aplicativo pré-compilado e o caminho virtual não foi encontrado no cache.This is a precompiled application and the virtual path was not found in the cache.

- ou --or-

Uma referência circular foi detectada.A circular reference was detected.

Comentários

Esse método retorna um objeto que permite que você gere um tipo compilando o caminho virtual.This method returns an object that enables you to generate a type by compiling the virtual path. Ele retorna um objeto, independentemente de o site ser pré-compilado ou não.It returns an object regardless of whether the Web site is precompiled.

Aplica-se a