LC 工作
更新:2007 年 11 月
包裝 LC.exe,該程式從 .licx 檔案產生 .license 檔案。如需 LC.exe 的詳細資訊,請參閱授權編譯器 (Lc.exe)。
參數
下表說明 LC 工作的參數。
參數 |
描述 |
---|---|
ExitCode |
選擇性 (Optional) Int32 輸出唯讀參數。 指定由執行的命令所提供的結束代碼 (Exit Code)。 |
LicenseTarget |
必要的 ITaskItem 參數。 指定要產生 .licenses 檔案的可執行檔。 |
NoLogo |
選擇性 (Optional) 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 之架構版本的 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>