5

Is there any difference between ReferencePath with condition '%(CopyLocal)'=='true' and ReferenceCopyLocalPaths?

The question was raised by this answer which uses both ways in two pieces of code.

Community
  • 1
  • 1
SiberianGuy
  • 24,674
  • 56
  • 152
  • 266

1 Answers1

14

ReferencePath: Paths to resolved primary files.

ReferenceCopyLocalPaths: references that are marked as "CopyLocal" and their dependencies, including .pdbs, .xmls and satellites.

To test each item contents, add this to your .csproj file:

<Target Name="AfterBuild">
    <Message Text="1. ReferencePath:%0D%0A%09@(ReferencePath->'$(OutDir)%(DestinationSubDirectory)%(Filename)%(Extension)', '%0D%0A%09')" />
    <Message Text="2. ReferenceCopyLocalPaths:%0D%0A%09@(ReferenceCopyLocalPaths->'$(OutDir)%(DestinationSubDirectory)%(Filename)%(Extension)', '%0D%0A%09')" />
</Target>
KMoraz
  • 14,004
  • 3
  • 49
  • 82
  • 2
    Don't forget about ```Importance="High"``` attribute if you build project by Visual Studio. https://stackoverflow.com/a/10518668/1193727 – resnyanskiy Oct 19 '17 at 10:04