Note that there are some explanatory texts on larger screens.

plurals
  1. PODefineCustomFiles and CustomCollectFiles are not fired by TeamCity
    text
    copied!<p>I'm trying to publish extra files with TeamCity. I also opened a subject here: <a href="https://stackoverflow.com/questions/16969883/publish-extra-dll-files-not-included-in-the-web-project">Publish extra dll files not included in the web project</a> but here I'm focused on the fact that DefineCustomFiles and CustomCollectFiles seem not fired.</p> <p>My build step looks like this:</p> <p><img src="https://i.stack.imgur.com/yht81.png" alt="TeamCity build step"></p> <p>And my custom build file looks like this :</p> <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt; &lt;!-- This file is used by the publish/package process of your Web project. You can customize the behavior of this process by editing this MSBuild file. In order to learn more about this please visit http://go.microsoft.com/fwlink/?LinkID=208121. --&gt; &lt;Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003"&gt; &lt;Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v10.0\WebApplications\Microsoft.WebApplication.targets" /&gt; &lt;PropertyGroup&gt; &lt;Configuration&gt;Release&lt;/Configuration&gt; &lt;CopyAllFilesToSingleFolderForPackageDependsOn&gt; DefineCustomFiles; CustomCollectFiles; $(CopyAllFilesToSingleFolderForPackageDependsOn); &lt;/CopyAllFilesToSingleFolderForPackageDependsOn&gt; &lt;/PropertyGroup&gt; &lt;Target Name="BuildAll" DependsOnTargets="Compile"&gt; &lt;Message Text="=== BuildAll ===" Importance="high" /&gt; &lt;/Target&gt; &lt;Target Name="Compile"&gt; &lt;Message Text="=== Compile ===" Importance="high" /&gt; &lt;MSBuild Projects="$(SolutionFile)" Properties="Configuration=$(Configuration)" /&gt; &lt;/Target&gt; &lt;Target Name="DefineCustomFiles"&gt; &lt;Message Text="=== DefineCustomFiles ===" Importance="high" /&gt; &lt;ItemGroup&gt; &lt;CustomFilesToInclude Include="example01.txt" /&gt; &lt;/ItemGroup&gt; &lt;/Target&gt; &lt;Target Name="CustomCollectFiles"&gt; &lt;Message Text="=== CustomCollectFiles ===" Importance="high" /&gt; &lt;ItemGroup&gt; &lt;FilesForPackagingFromProject Include="@(CustomFilesToInclude)"&gt; &lt;DestinationRelativePath&gt;%(Filename)%(Extension)&lt;/DestinationRelativePath&gt; &lt;/FilesForPackagingFromProject&gt; &lt;/ItemGroup&gt; &lt;/Target&gt; &lt;/Project&gt; </code></pre> <p>The example01.txt file is at the root of my project, like my custom build file.</p> <p>Problems:</p> <ul> <li>I can't see the DefineCustomFiles and CustomCollectFiles targets fired in TeamCity's log</li> <li>My example file is not added during the publication</li> </ul> <p>Thanks for any help!</p> <p><strong>UPDATE</strong></p> <p>The problem comes from the separate file! Now I use the standard .csproj file with this at the end:</p> <pre><code>&lt;PropertyGroup&gt; &lt;CopyAllFilesToSingleFolderForPackageDependsOn&gt; CustomCollectFiles; $(CopyAllFilesToSingleFolderForPackageDependsOn); &lt;/CopyAllFilesToSingleFolderForPackageDependsOn&gt; &lt;/PropertyGroup&gt; &lt;Target Name="CustomCollectFiles"&gt; &lt;Message Text="=== CustomCollectFiles ===" Importance="high" /&gt; &lt;ItemGroup&gt; &lt;_CustomFiles Include="..\Extra Files\**\*" /&gt; &lt;FilesForPackagingFromProject Include="%(_CustomFiles.Identity)"&gt; &lt;DestinationRelativePath&gt;%(RecursiveDir)%(Filename)%(Extension)&lt;/DestinationRelativePath&gt; &lt;/FilesForPackagingFromProject&gt; &lt;/ItemGroup&gt; &lt;/Target&gt; </code></pre> <p>And it works, oh yeah!!</p> <p><strong>UPDATE</strong></p> <p>And my build step in Team City is finally:</p> <p><img src="https://i.stack.imgur.com/FkiuS.png" alt="enter image description here"></p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload