ClientBuildManager.PrecompileApplication 方法

定义

预编译 ASP.NET 应用程序。Precompiles an ASP.NET application.

重载

PrecompileApplication()

预编译 ASP.NET 应用程序。Precompiles an ASP.NET application.

PrecompileApplication(ClientBuildManagerCallback)

预编译 ASP.NET 应用程序,并提供回调方法来接收有关生成的状态信息。Precompiles an ASP.NET application and provides a callback method to receive status information about the build.

PrecompileApplication(ClientBuildManagerCallback, Boolean)

预编译 ASP.NET 应用程序,提供回调方法以接收有关生成的状态信息,并指示是否创建干净生成。Precompiles an ASP.NET application, provides a callback method to receive status information about the build, and indicates whether to create a clean build.

注解

ASP.NET 支持三种形式的预编译。ASP.NET supports three forms of precompilation. 一个窗体允许 ASP.NET 应用程序的就地预编译。One form allows for the in-place precompilation of an ASP.NET application. 在此窗体中,站点部署到生产环境中,然后进行预编译,这样就无需在用户第一次访问站点时动态编译站点。In this form, the site is deployed to production and then precompiled, which eliminates the need to dynamically compile the site when it is first visited by a user. 站点的第一个用户不会遇到在动态编译的站点上通常会遇到的延迟。The first user of the site will not experience the delay normally encountered on a site that is dynamically compiled.

另外两种形式的预编译用于部署。The two other forms of precompilation are used for deployment. 在任一窗体中,都会生成可以部署到生产计算机的站点布局。In either form, a layout of the site is generated that can be deployed to a production computer. 其中一种形式包括标记页,因此可以在编译的站点上执行一定量的更新。One of these forms includes the markup pages so some amount of updating can be performed on the compiled site. 另一种形式不包含标记页,因此无法在不重新编译原始站点的情况下进行更新。The other form does not contain the markup pages and therefore cannot be updated without recompiling the original site. 对于这两种形式的预编译,都不会将源代码部署到目标环境。No source code is deployed to the target environment in either of these forms of precompilation.

用于预编译的应用程序是通过 ClientBuildManager 构造函数定义的。The application to precompile is defined through the ClientBuildManager constructor. ClientBuildManager 构造函数的 ClientBuildManagerParameter 对象定义要执行的三种形式的预编译中的哪一种。The ClientBuildManagerParameter object of the ClientBuildManager constructor defines which of the three forms of precompilation to perform.

开发人员可以使用 aspnet_compiler 命令行工具或通过调用 PrecompileApplication 方法预编译网站。A developer can precompile a Web site with the aspnet_compiler command-line tool or by calling the PrecompileApplication method.

PrecompileApplication()

预编译 ASP.NET 应用程序。Precompiles an ASP.NET application.

public:
 void PrecompileApplication();
public void PrecompileApplication ();
member this.PrecompileApplication : unit -> unit
Public Sub PrecompileApplication ()

注解

ASP.NET 支持三种形式的预编译。ASP.NET supports three forms of precompilation. 一个窗体允许 ASP.NET 应用程序的就地预编译。One form allows for the in-place precompilation of an ASP.NET application. 在此窗体中,站点部署到生产环境中,然后进行预编译,这样就无需在用户第一次访问站点时动态编译站点。In this form, the site is deployed to production and then precompiled, which eliminates the need to dynamically compile the site when it is first visited by a user. 站点的第一个用户不会遇到在动态编译的站点上通常会遇到的延迟。The first user of the site will not experience the delay normally encountered on a site that is dynamically compiled.

另外两种形式的预编译用于部署。The two other forms of precompilation are used for deployment. 在任一窗体中,都会生成可以部署到生产计算机的站点布局。In either form, a layout of the site is generated that can be deployed to a production computer. 其中一种形式包括标记页,因此可以在编译的站点上执行一定量的更新。One of these forms includes the markup pages so some amount of updating can be performed on the compiled site. 另一种形式不包含标记页,因此无法在不重新编译原始站点的情况下进行更新。The other form does not contain the markup pages and therefore cannot be updated without recompiling the original site. 对于这两种形式的预编译,都不会将源代码部署到目标环境。No source code is deployed to the target environment in either of these forms of precompilation.

用于预编译的应用程序是通过 ClientBuildManager 构造函数定义的。The application to precompile is defined through the ClientBuildManager constructor. ClientBuildManager 构造函数的 ClientBuildManagerParameter 对象定义要执行的三种形式的预编译中的哪一种。The ClientBuildManagerParameter object of the ClientBuildManager constructor defines which of the three forms of precompilation to perform.

开发人员可以使用 aspnet_compiler 命令行工具或通过调用 PrecompileApplication 方法预编译网站。A developer can precompile a Web site with the aspnet_compiler command-line tool or by calling the PrecompileApplication method.

另请参阅

PrecompileApplication(ClientBuildManagerCallback)

预编译 ASP.NET 应用程序,并提供回调方法来接收有关生成的状态信息。Precompiles an ASP.NET application and provides a callback method to receive status information about the build.

public:
 void PrecompileApplication(System::Web::Compilation::ClientBuildManagerCallback ^ callback);
public void PrecompileApplication (System.Web.Compilation.ClientBuildManagerCallback callback);
member this.PrecompileApplication : System.Web.Compilation.ClientBuildManagerCallback -> unit
Public Sub PrecompileApplication (callback As ClientBuildManagerCallback)

参数

callback
ClientBuildManagerCallback

包含报告编译结果时要调用的方法的 ClientBuildManagerCallbackA ClientBuildManagerCallback containing the method to call when reporting the result of compilation.

注解

ASP.NET 支持三种形式的预编译。ASP.NET supports three forms of precompilation. 一个窗体允许 ASP.NET 应用程序的就地预编译。One form allows for the in-place precompilation of an ASP.NET application. 在此窗体中,站点部署到生产环境中,然后进行预编译,这样就无需在用户第一次访问站点时动态编译站点。In this form, the site is deployed to production and then precompiled, which eliminates the need to dynamically compile the site when it is first visited by a user. 站点的第一个用户不会遇到在动态编译的站点上通常会遇到的延迟。The first user of the site will not experience the delay normally encountered on a site that is dynamically compiled. callback 参数包含报告编译结果时要调用的方法。The callback parameter contains the method to call when reporting the result of compilation.

另外两种形式的预编译用于部署。The two other forms of precompilation are used for deployment. 在任一窗体中,都会生成可以部署到生产计算机的站点布局。In either form, a layout of the site is generated that can be deployed to a production computer. 其中一种形式包括标记页,因此可以在编译的站点上执行一定量的更新。One of these forms includes the markup pages so some amount of updating can be performed on the compiled site. 另一种形式不包含标记页,因此无法在不重新编译原始站点的情况下进行更新。The other form does not contain the markup pages and therefore cannot be updated without recompiling the original site. 对于这两种形式的预编译,都不会将源代码部署到目标环境。No source code is deployed to the target environment in either of these forms of precompilation.

用于预编译的应用程序是通过 ClientBuildManager 构造函数定义的。The application to precompile is defined through the ClientBuildManager constructor. ClientBuildManager 构造函数的 ClientBuildManagerParameter 对象定义要执行的三种形式的预编译中的哪一种。The ClientBuildManagerParameter object of the ClientBuildManager constructor defines which of the three forms of precompilation to perform.

开发人员可以使用 aspnet_compiler 命令行工具或通过调用 PrecompileApplication 方法预编译网站。A developer can precompile a Web site with the aspnet_compiler command-line tool or by calling the PrecompileApplication method.

另请参阅

PrecompileApplication(ClientBuildManagerCallback, Boolean)

预编译 ASP.NET 应用程序,提供回调方法以接收有关生成的状态信息,并指示是否创建干净生成。Precompiles an ASP.NET application, provides a callback method to receive status information about the build, and indicates whether to create a clean build.

public:
 void PrecompileApplication(System::Web::Compilation::ClientBuildManagerCallback ^ callback, bool forceCleanBuild);
public void PrecompileApplication (System.Web.Compilation.ClientBuildManagerCallback callback, bool forceCleanBuild);
member this.PrecompileApplication : System.Web.Compilation.ClientBuildManagerCallback * bool -> unit
Public Sub PrecompileApplication (callback As ClientBuildManagerCallback, forceCleanBuild As Boolean)

参数

callback
ClientBuildManagerCallback

包含报告编译结果时要调用的方法的 ClientBuildManagerCallbackA ClientBuildManagerCallback containing the method to call when reporting the result of compilation.

forceCleanBuild
Boolean

true 执行干净生成,这将首先删除所有对象和中间文件;false 则仅重新生成那些已更改的文件。true to perform a clean build, which will first delete all object and intermediate files; false to rebuild only those files that have changed. 如果存在生成环境可能不选取依赖项的可能性,则设置为 true。Set to true if there is a chance that a dependency might not be picked up by the build environment.

注解

ASP.NET 支持三种形式的预编译。ASP.NET supports three forms of precompilation. 一个窗体允许 ASP.NET 应用程序的就地预编译。One form allows for the in-place precompilation of an ASP.NET application. 在此窗体中,站点部署到生产环境中,然后进行预编译,这样就无需在用户第一次访问站点时动态编译站点。In this form, the site is deployed to production and then precompiled, which eliminates the need to dynamically compile the site when it is first visited by a user. 站点的第一个用户不会遇到在动态编译的站点上通常会遇到的延迟。The first user of the site will not experience the delay normally encountered on a site that is dynamically compiled. callback 参数包含报告编译结果时要调用的方法。The callback parameter contains the method to call when reporting the result of compilation.

另外两种形式的预编译用于部署。The two other forms of precompilation are used for deployment. 在任一窗体中,都会生成可以部署到生产计算机的站点布局。In either form, a layout of the site is generated that can be deployed to a production computer. 其中一种形式包括标记页,因此可以在编译的站点上执行一定量的更新。One of these forms includes the markup pages so some amount of updating can be performed on the compiled site. 另一种形式不包含标记页,因此无法在不重新编译原始站点的情况下进行更新。The other form does not contain the markup pages and therefore cannot be updated without recompiling the original site. 对于这两种形式的预编译,都不会将源代码部署到目标环境。No source code is deployed to the target environment in either of these forms of precompilation.

用于预编译的应用程序是通过 ClientBuildManager 构造函数定义的。The application to precompile is defined through the ClientBuildManager constructor. ClientBuildManager 构造函数的 ClientBuildManagerParameter 对象定义要执行的三种形式的预编译中的哪一种。The ClientBuildManagerParameter object of the ClientBuildManager constructor defines which of the three forms of precompilation to perform.

开发人员可以使用 aspnet_compiler 命令行工具或通过调用 PrecompileApplication 方法预编译网站。A developer can precompile a Web site with the aspnet_compiler command-line tool or by calling the PrecompileApplication method.

另请参阅

适用于