我想在一個C#項目文件中使用ILMerge將某些DLL組合成一個DLL(出於各種原因)。我從https://github.com/loresoft/msbuildtasks下載了具有ILMerge目標的MSBuild社區任務。MSBuild社區任務 - ILMerge無效的命令行切換路徑1
我正在嘗試使用ILMerge目標時,這個名不見經傳的錯誤消息:
"C:\svn\AwaitingFeedbackCanceller.csproj" (rebuild target) (1) ->
(Zip target) ->
C:\svn\AwaitingFeedbackCanceller.csproj(150,5): error MSB6001: Invalid command line switch for "ILMerge.exe".
Value cannot be null.\r
C:\svn\AwaitingFeedbackCanceller.csproj(150,5): error MSB6001: Parameter name: path1
這些都是從我的項目文件中的相關位:
<PropertyGroup>
<ZipFileName>$(ProjectName)-$([System.String]::Copy('$(projectguid)').Trim('\{\}')).zip</ZipFileName>
<MergedFile>$(ProjectDir)$(ProjectName).dll</MergedFile>
<logFile>$(ProjectDir)$(ProjectName).log</logFile>
<TargetPlatformVersion>v4</TargetPlatformVersion>
<TargetPlatformDirectory>C:\Windows\Microsoft.NET\Framework64\v4.0.30319</TargetPlatformDirectory>
</PropertyGroup>
<ItemGroup>
<inputAssemblies Include="$(ProjectDir)$(OutDir)$(AssemblyName).dll" />
<inputAssemblies Include="$(ProjectDir)$(OutDir)AeriandiGeminiPluginBase.dll" />
<allowDuplicates Include="$(ProjectDir)$(OutDir)ClassAB" />
</ItemGroup>
<Target Name="Merge">
<Message Importance="high" Text="Merging assemblies" />
<ILMerge InputAssemblies="@(inputAssemblies)" AllowDuplicateTypes="@(allowDuplicates)" OutputFile="$(MergedFile)" LogFile="$(logFile)" DebugInfo="true" XmlDocumentation="true" TargetPlatformVersion="$(TargetPlatformVersion)" TargetPlatformDirectory="$(TargetPlatformDirectory)" />
</Target>
這是真的開始抱我因爲我需要自動部署一些項目。
任何人都可以指出我做錯了什麼?
乾杯,
阿什利
披露:我也加入了這個問題,對這些問題在Github上這個項目,但還沒有一個迴應 - https://github.com/loresoft/msbuildtasks/issues/42。