我正在尝试使用要在 Assemblyinfo.cs 上使用的 MSBuild 检索 svn 修订号,但修订号返回 -1。该脚本如下所示,使用 slik subversion 1.8。我已经打开了 MSBuild 的诊断,并且 svnversion 确实返回 -1。最奇怪的是它在遗留项目上运行良好。
有任何想法吗?
干杯保罗
<Target Name="Version">
<XmlRead XPath="/Revolution/Major" XmlFileName="$(MSBuildProjectDirectory)\..\Version.xml">
<Output TaskParameter="Value" PropertyName="Major" />
</XmlRead>
<XmlRead XPath="/Revolution/Minor" XmlFileName="$(MSBuildProjectDirectory)\..\Version.xml">
<Output TaskParameter="Value" PropertyName="Minor" />
</XmlRead>
<SvnVersion LocalPath="$(MSBuildProjectDirectory)" ToolPath="$(ProgramFiles)\SlikSvn-1.6.9\bin">
<Output TaskParameter="Revision" PropertyName="Revision" />
</SvnVersion>
<Message Text="Version: $(Major).$(Minor).$(Revision).0" />
<AssemblyInfo CodeLanguage="CS" OutputFile="Properties\AssemblyInfo.cs" AssemblyTitle="ITL.Fuel.Client" AssemblyDescription="ITL.Fuel.Client" AssemblyCompany="Ingenitech (NZ) Limited" AssemblyProduct="ITL.Fuel.Client" AssemblyCopyright="Copyright © Ingenitech (NZ) Limited 2008" ComVisible="false" Guid="51ec449f-f5fa-4506-b89f-77b743f02988" AssemblyVersion="$(Major).$(Minor).$(Revision).0" />