当前位置 : 主页 > 网络编程 > ASP >

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

来源:互联网 收集:自由互联 发布时间:2021-06-24
我目前正在为Web项目设置构建服务器.我正在使用Web部署项目来创建可部署的程序包,我想进行一些简单的文件管理(复制webDeploy.config – web.config并删除.csproj文件). 我的目标如下: Target
我目前正在为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".

部署路径确实包含调试路径.我究竟做错了什么?

如果要使用通配符,则必须在项列表中执行此操作.项目列表将负责为您扩展通配符.所以在你的情况下:

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