csproj 中的 MSBuild 删除不执行任何操作
我尝试使用 MSBuild 删除 OutDir 中的一些文件,但它从未起作用。我必须使用 Exec 来代替。
<Target Name="ResetPackages" BeforeTargets="DispatchToInnerBuilds">
<Exec Command = "del /Q /F $(OutDir)*.extension/>
<Delete Files="$(OutDir)*.extension" />
</Target>
Exec 命令有效,而 Delete 命令不执行任何操作。有人能解释我为什么吗?
I try to use MSBuild to delete some files in the OutDir but it never works. I have to use an Exec instead.
<Target Name="ResetPackages" BeforeTargets="DispatchToInnerBuilds">
<Exec Command = "del /Q /F $(OutDir)*.extension/>
<Delete Files="$(OutDir)*.extension" />
</Target>
The Exec command works while Delete does nothing. Can anybody explain me why ?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如果您希望扩展通配符,则需要将 ItemGroup 传递给
Delete
:(Exec-Task 运行
CMD.EXE
,然后执行通配符扩展。)You need to pass an ItemGroup to
Delete
if you want wildcards to be expanded:(The Exec-Task runs
CMD.EXE
which then does the wildcard expansion.)