【问题标题】:What do I specify as the "target folder" parameter to ClientBuildManager constructor?我将什么指定为 ClientBuildManager 构造函数的“目标文件夹”参数?
【发布时间】:2026-01-01 13:00:01
【问题描述】:

我想试验一下ClientBuildManager class constructor 的第四个参数,它可以让我指定编译选项。问题是我必须提供指定“目标文件夹”的第三个参数。

以前我是这样使用two-paremeters constructor的:

VirtualDirectory dir = ...;
using( var buildManager = new ClientBuildManager( dir.Path, dir.PhysicalPath ) ) {
     buildManager.PrecompileApplication();
}

它工作正常 - 这两个参数非常明显。

我不知道从哪里获得第三个“目标文件夹”参数。

如何获取可以作为第三个“目标文件夹”参数传递的值,以便预编译像以前一样工作?

【问题讨论】:

    标签: c# asp.net .net iis pre-compilation


    【解决方案1】:

    如果您只想"Compiling an Application in Place",您可以为 TargetFolder 传递 null。如果您为 TargetFolder 传递一个有效的文件夹,您将是 "Compiling an Application for Deployment"

    【讨论】: