Coder949
Coder949

Reputation: 1007

Copy file to folder before build csproj

I can not figure out how to copy a file into another folder before the build is done. It is a Xamarin.Forms project.

My current approach is:

<Target Name="BeforeBuild">
    <ItemGroup>
      <CrossFiles Include="..\path\$(Configuration)\droid\AndroidManifest.xml;" />
    </ItemGroup>

    <Copy SourceFiles="@(CrossFiles)" DestinationFolder="Properties/" SkipUnchangedFiles="true" />
</Target>

It is on the bottom of the file directly above </Project>.

This approach seems to have no effect. What I am doing wrong ? Thanks for your help.

Upvotes: 1

Views: 740

Answers (1)

Sean Schoeman
Sean Schoeman

Reputation: 34

try add the output path varaible to the destination folder:

DestinationFolder="$(OutputPath)\Properties"

Upvotes: 1

Related Questions