MSBuild引擎为'$(MSBuild::Add($(OldRevision),1))‘语句返回错误MSB4186。我使用了一个来自here的例子,但它不适用于我:
error MSB4186: Invalid static method invocation syntax:
"[MSBuild]::Add($(OldRevision), 1)". Input string was not in a correct format.
Static method invocation should be of the form: $([FullTypeName]::Method()),
e.g. $([System.IO.Path]::Combine(`a`, `b`))以下是我正在尝试执行的操作:
<CreateProperty Value="$([MSBuild]::Add($(OldRevision), 1))">
<Output
TaskParameter="Value"
PropertyName="NewRevision" />
</CreateProperty>我想知道它的正确语法是什么
附注:是,我使用的是MSBuild 4.5
发布于 2012-12-13 09:14:09
我认为你的这个属性语法是正确的,它只是在CreateProperty任务中不起作用。CreateProperty函数已弃用,使用它的理由很少。
这个更简单的属性语法适用于我:
<PropertyGroup>
<NewVersion>$([MSBuild]::Add($(OldVersion), 1))</NewVersion>
</PropertyGroup>同样,这也适用于(在任何目标中):
<Message Text="OldVersion=$(OldVersion), NewVersion=$([MSBuild]::Add($(OldVersion), 1))" />https://stackoverflow.com/questions/13847857
复制相似问题