AfterBuild Web Deployment Issues

I am currently setting up a build server for a web project. I am using a web deployment project to create a deployable package and I want to do some simple file administration (copy webDeploy.config -> web.config and delete the .csproj files).

My goal is as follows:

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

However, checking the WDP output gives me this

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".

The deployment path does contain a debug path. What am I doing wrong?

+3
source share
2 answers

, . . , :

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

, : ( MSBuild).

:

<ItemGroup>
    <ProjectConfigFiles Include="$(OutputPath)\*.csproj" />
</ItemGroup>

<Target Name="AfterBuild">      
    <Delete Files="@(ProjectConfigFiles)" />
</Target>
0

Source: https://habr.com/ru/post/1730376/


All Articles