我在Jenkins上收到此構建錯誤。我會很感激任何幫助爲它尋找解決方案,甚至有人指出我正確的方向。「AssemblyInfo」在Jenkins構建的MSBuild任務失敗
這是我得到的錯誤:
「d:\詹金斯\工作*絕密* \工作區\ CAPS.msbuild」(默認目標) (1) - >(編譯目標) - >錯誤MSB4018:「AssemblyInfo」任務 意外失敗。 System.ArgumentException:version參數 name:指定的字符串不是有效的版本號 Microsoft.Build.Extras.Version.ParseVersion(String version)at Microsoft.Build.Extras.AssemblyInfo.Execute()at Microsoft。 Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute() 在 Microsoft.Build.BackEnd.TaskBuilder.d__20.MoveNext()
我驗證過的AssemblyInfo.cs文件的所有看起來不錯(據我所知),沒有什麼似乎與該解決方案的msbuild文件。
我已經谷歌搜索了我能想到的所有錯誤的派生。
任何意見,將不勝感激。
評論迴應:
從AssemblyInfo.cs文件:
[assembly: AssemblyVersion("2.0.*")]
從MSBuild的文件:
<PropertyGroup>
<ProjectName>CAPS</ProjectName>
<Configuration Condition=" '$(Configuration)' == '' ">Release</Configuration>
<VersionLabel Condition=" '$(VersionLabel)' == '' ">0.0</VersionLabel>
<AssemblyVersion>2.0.$(VersionLabel)</AssemblyVersion>
</PropertyGroup>
這也可能是相關的:
<Target Name="Compile">
<ItemGroup>
<UpdateFiles Include="**\AssemblyInfo.cs" Exclude="**\.svn\**" />
</ItemGroup>
<AssemblyInfo AssemblyInfoFiles="@(UpdateFiles)" AssemblyVersion="$(AssemblyVersion)" AssemblyFileVersion="$(AssemblyVersion)"/>
<MSBuild Projects="$(ProjectName).sln" Properties="Configuration=$(Configuration);RunCodeAnalysis=true" />
</Target>
'指定的字符串不是有效的版本號' - 你試圖寫什麼版本號? –
用信息更新了問題。 –
...和'$(AssemblyVersion)'得到期望值? ''可以告訴你。 –