Link

How to make Visual Studio copy a file from a folder in the project to the Output Folder!

The answer is in Stack Overflow 😉

NOTICE. The answer told you to put OutputPath, but I used OutDir

http://stackoverflow.com/a/4326337/1025407

Modify the CSPROJ adding this snippet:

 <ItemGroup>
    <AvailableItemName Include="RootContent">
      <Visible>false</Visible>
    </AvailableItemName>
  </ItemGroup>
  <Target Name="AfterBuild">
    <Message Text="Copiando bibliotecas nativas a carpeta de salida" />
    <Copy DestinationFolder="$(OutDir)" SourceFiles="@(RootContent)" SkipUnchangedFiles="true" />
  </Target>

Go the to Solution Explorer and go to the properties of the file you want to copy to the output folder (usually bin). Set the Build Action to RootContent.

Done!

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s