0

我们正在使用 cc.net(巡航控制)和 msbuild 来构建一次点击应用程序。这是 msbuild 任务:

<msbuild>
    <executable>C:\Program Files (x86)\MSBuild\14.0\Bin\MSBuild.exe</executable>
    <workingDirectory>D:\Directory</workingDirectory>
    <projectFile>proj.lsxtproj</projectFile>
    <buildArgs>/t:publish /p:PublishLocation=D:\Publish\;AssemblyFileVersion=$CCNetLabel;AssemblyVersion=$CCNetLabel</buildArgs>
    <targets>Build</targets>
    <timeout>600</timeout>
</msbuild>

所以我正在尝试设置已发布输出的程序集文件版本和程序集版本。

问题是变量 $CCNetLabel 似乎不起作用。如果我将 AssemblyFileVersion 和 AssemblyVersion 设置为 3.2.0.0 之类的值,则输出具有此版本号,但 $CCNetLabel 不起作用。

有没有人有任何想法如何使这项工作?

谢谢伊恩

4

1 回答 1

0

如果问题是 $(CCNetLabel) 为空白,请尝试使用“动态”变量。所以而不是:

AssemblyFileVersion=$CCNetLabel;

利用:

AssemblyFileVersion=$[$CCNetLabel];

否则看看这个其他问题,它有更多关于 AssemblyInfo.cs 的信息,可能会有所帮助:

使用 CCNetLabel 通过 CruiseControl.NET 设置 AssemblyVersion 和 PublishVersion

于 2021-02-10T10:33:11.227 回答