Share via


LC 任务

更新:2007 年 11 月

包装 LC.exe,该任务基于 .licx 文件生成 .license 文件。有关 LC.exe 的更多信息,请参见许可证编译器 (Lc.exe)

参数

下表描述了 LC 任务的参数。

参数

说明

ExitCode

可选的 Int32 只读输出参数。

指定由执行的命令提供的退出代码。

LicenseTarget

必选的 ITaskItem 参数。

指定将为其生成 .licenses 文件的可执行文件。

NoLogo

可选的 Boolean 参数。

取消显示 Microsoft 启动标题。

OutputDirectory

可选的 String 参数。

指定用来放置 .licenses 输出文件的目录。

OutputLicense

可选的 ITaskItem 输出参数。

指定 .licenses 文件的名称。如果未指定名称,将使用 .licx 文件的名称,并且 .licenses 文件将放置在包含 .licx 文件的目录中。

ReferencedAssemblies

可选的 ITaskItem[] 参数。

指定将在生成 .license 文件时加载的引用组件。

Sources

必选的 ITaskItem[] 参数。

指定要包括在 .licenses 文件中的项,这些项包含许可使用的组件。有关更多信息,请参见有关许可证编译器 (Lc.exe) 中的 /complist 开关的文档。

Timeout

可选的 Int32 参数。

指定在多少毫秒后终止任务可执行文件。默认值为 Int.MaxValue,这表示没有超时期限。

ToolPath

可选的 String 参数。

指定任务将从什么位置加载基础可执行文件 (Lc.exe)。如果未指定此参数,任务将使用与运行 MSBuild 的 Framework 版本对应的 SDK 安装路径。

示例

下面的示例使用 LC 任务来编译许可证。

<Project xmlns="https://schemas.microsoft.com/developer/msbuild/2003">
<!-- Item declarations, etc -->

    <Target Name="CompileLicenses">
        <LC
            Sources="@(LicxFile)"
            LicenseTarget="$(TargetFileName)"
            OutputDirectory="$(IntermediateOutputPath)"
            OutputLicenses="$(IntermediateOutputPath)$(TargetFileName).licenses"
            ReferencedAssemblies="@(ReferencePath);@(ReferenceDependencyPaths)">

            <Output
                TaskParameter="OutputLicenses"
                ItemName="CompiledLicenseFile"/>
        </LC>
    </Target>
</Project>

请参见

概念

MSBuild 任务

其他资源

MSBuild 任务参考