1

I have two xml files in the root of my solution that need to be copied to the deploy folder's parent.

My website is being deployed to D:\test\website but I want to make an exception for 2 xml files that need to be relocated outside of this folder. so I need the two xml files to be moved to D:\test.

Currently I have the following lines in my publish profile:

  <Target Name="CustomCollectFiles">
    <ItemGroup>
      <_CustomFiles Include="..\fileA.xml" />
      <_CustomFiles Include="..\fileB.xml" />
      <FilesForPackagingFromProject Include="%(_CustomFiles.Identity)">
        <DestinationRelativePath>%(RecursiveDir)%(Filename)%(Extension)</DestinationRelativePath>
      </FilesForPackagingFromProject>
    </ItemGroup>
  </Target>

It can find the two files, but they aren't located in D:\test. However, they are present in the deploy folder. I have tried many things to get things to get this to work, like:

..\%(RecursiveDir)%(Filename)%(Extension)
..\%(Filename)%(Extension)
%(Filename)%(Extension)

At this moment I have no idea what I'm doing anymore. Any help will be much appreciated!

  • You could try `%(RecursiveDir)\..\%(Filename)%(Extension)` – Troopers Nov 27 '15 at 15:28
  • That one doesn't seem to work aswell :( When I try this, they aren't located in the deploy folder (which is good) but they aren't located in the parent folder either (where I need them to be) – William van Velzen Nov 27 '15 at 16:16

0 Answers0