BuildProvider.RegisterBuildProvider(String, Type) 方法

定义

注册一个生成提供程序。Registers a build provider.

public:
 static void RegisterBuildProvider(System::String ^ extension, Type ^ providerType);
public static void RegisterBuildProvider (string extension, Type providerType);
static member RegisterBuildProvider : string * Type -> unit
Public Shared Sub RegisterBuildProvider (extension As String, providerType As Type)

参数

extension
String

生成提供程序所针对的文件扩展名。The file-name extension that the build provider is for.

providerType
Type

生成提供程序类。The build provider class.

注解

您可以使用此方法来注册生成提供程序,而不是在 Web.config 文件中定义它们。You can use this method to register build providers instead of defining them in the Web.config file. 有关生成提供程序的详细信息,请参阅 BuildProvider buildProviders 的 class And 元素 (For ASP.NET Settings Schema) For more information about build providers, see the BuildProvider class and buildProviders Element for compilation (ASP.NET Settings Schema).

适用于