共用方式為


LC 工作

包裝 LC.exe,該程式從 .licx 檔案產生 .license 檔案。 如需 LC.exe 的詳細資訊,請參閱Lc.exe (授權編譯器)

參數

下表說明 LC 工作的參數。

參數

描述

LicenseTarget

必要的 ITaskItem 參數。

指定要產生 .licenses 檔案的可執行檔。

NoLogo

選擇性 Boolean 參數。

隱藏 Microsoft 程式啟始資訊顯示。

OutputDirectory

選擇性 String 參數。

指定要放置輸出 .licenses 檔案的目錄。

OutputLicense

選擇性的 ITaskItem 輸出參數。

指定 .licenses 檔案的名稱。 如果沒有指定名稱,便會使用 .licx 檔案的名稱,並將 .licenses 檔案置於含有 .licx 檔案的目錄中。

ReferencedAssemblies

選擇性 ITaskItem[] 參數。

指定要在產生 .license 檔案時載入的參考元件。

SdkToolsPath

選擇性 String 參數。

指定 SDK 工具 (例如 resgen.exe) 的路徑。

Sources

必要的 ITaskItem[] 參數。

指定含有授權元件的項目以包括在 .licenses 檔案中。 如需詳細資訊,請參閱Lc.exe (授權編譯器) 之中 /complist 參數的文件。

除了以上列出的參數之外,此項工作還會繼承 ToolTaskExtension 類別中的參數,而該類別本身又繼承 ToolTask 類別。 如需這些錯誤碼的清單及其說明,請參閱 ToolTaskExtension 基底類別

範例

下列範例使用 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 工作參考