gpt4 book ai didi

asp.net - Web部署项目AfterBuild路径问题

转载 作者:行者123 更新时间:2023-12-01 10:14:47 25 4
gpt4 key购买 nike

我目前正在为 Web 项目设置构建服务器。我正在使用 Web 部署项目创建一个可部署的包,我想做一些简单的文件管理(复制 webDeploy.config -> web.config 并删除 .csproj 文件)。

我的目标如下所示:

<Target Name="AfterBuild">      
<Delete Files="$(OutputPath)\*.csproj" />
</Target>

但是,检查 WDP 的输出给了我这个

Target "AfterBuild" in file "C:\project\Deployment\Project.Deployment.wdproj": 
Task "Delete"
File ".\Debug\*.*" doesn't exist. Skipping.
Done executing task "Delete".
Done building target "AfterBuild" in project "Project.Deployment.wdproj".

Deployment 路径确实包含 Debug 路径。我做错了什么?

最佳答案

如果您想使用通配符,您必须在项目列表中这样做。项目列表将负责为您扩展通配符。所以在你的情况下:

<Target Name="AfterBuild">      
<ItemGroup>
<FilesToDelete Include="$(OutputPath)\*.csproj" />
</ItemGroup>
<Delete Files="@(FilesToDelete)" />
</Target>

关于asp.net - Web部署项目AfterBuild路径问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2154406/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com