我正在尝试为我的csproj添加一个Post Build MSBuild事件,为此我正在尝试从.csproj文件的Afterbuild目标中调用一个MSBuild任务。
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.-->
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
<Message Text="Copying Files" />
<MSBuild Projects="post.build"
Targets="Copy"
ContinueOnError="false" />
</Target>
这是 post.build 文件。
<Project DefaultTargets="Copy"
xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Target Name="Copy">
<Message Text="Copying Files inside COPY" />
<CallTarget Targets="CopyToProfile"/> </Target>
</project>
看起来csproj文件无法调用MSbuild任务,有人能建议一下出了什么问题吗?我收到了以下错误信息:
错误 MSB4057:项目中不存在目标“Copy”。