我只想使用msbuild命令行选项重新链接项目。默认选项是/ t:build。当我将其更改为/ t:link时,错误为MSB4057:项目中不存在目标“链接” 如何为此解决方案启用链接? [echo] msbuild / nologo / m / p:Configuration =“Release”/ p:Platform =“W in32“/p:VisualStudioVersion="11.0”/ t:link“../../XYZ.sln “
答案 0 :(得分:0)
我认为你错过了/ t参数的用途。
在下面的msbuild定义中。
我可以打电话给任何一个:
/t:AllTargetsWrapped
/t:CleanArtifactFolder
/t:BuildItUp
/t:CopyFilesToArtifactFolder
/t:RenameConfigurationFiles
或者我可以调用无目标,它将运行“AllTargetsWrapped”,因为它是默认目标。
你有
吗? <Target Name="link">
你的代码中有吗?
以下是我在上面的示例中引用的示例.proj定义。
<?xml version="1.0" encoding="utf-8"?>
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003" DefaultTargets="AllTargetsWrapped">
<PropertyGroup>
<!-- Always declare some kind of "base directory" and then work off of that in the majority of cases -->
<WorkingCheckout>.</WorkingCheckout>
</PropertyGroup>
<Target Name="AllTargetsWrapped">
<CallTarget Targets="CleanArtifactFolder" />
<CallTarget Targets="BuildItUp" />
<CallTarget Targets="CopyFilesToArtifactFolder" />
<CallTarget Targets="RenameConfigurationFiles" />
</Target>
<Target Name="CleanArtifactFolder">
<Message Text="CleanArtifactFolder was called" />
</Target>
<Target Name="BuildItUp">
<Message Text="BuildItUp was called" />
</Target>
<Target Name="CopyFilesToArtifactFolder">
<Message Text="CopyFilesToArtifactFolder was called" />
</Target>
<Target Name="RenameConfigurationFiles">
<Message Text="RenameConfigurationFiles was called" />
</Target>
</Project>
答案 1 :(得分:0)
您可以使用BuildLink target。