zivid / zivid-csharp-samples

Code samples for the usage of a Zivid 3D camera in C#
BSD 3-Clause "New" or "Revised" License
5 stars 1 forks source link

Strange HintPaths in csprojs #5

Closed knatten closed 4 years ago

knatten commented 4 years ago

For some reason we have these HintPaths in all our csprojs:

    <Reference Include="ZividCoreNET">
      <HintPath>..\..\..\..\..\..\Program Files\Zivid\bin\ZividCoreNET.dll</HintPath>
    </Reference>
    <Reference Include="ZividVis3DNET">
      <HintPath>..\..\..\..\..\..\Program Files\Zivid\bin\ZividVis3DNET.dll</HintPath>
    </Reference>

I don't understand why they're there, I assume this will only work if you happen to have cloned this repo at a very specific folder depth.

Maybe we should use ZIVID_INSTALL_FOLDER here, like we do in the xcopy commands? And maybe we should then specify the full path to the dll in the Include= attribute, instead of using a HintPath element?

I'm not sure what the best practice is here, but what we're currently doing seems wrong.

SatjaSivcev commented 4 years ago

This happens when you add reference and build it: image image

knatten commented 4 years ago

Yes, and that might be convenient if you have a local project you're working on on your machine alone. But the paths will only be valid on that particular machine, and shouldn't be committed to a shared repository imo.

SatjaSivcev commented 4 years ago

Then instead we should have a tutorial on how to add references?

knatten commented 4 years ago

No we need to add these references, but we need to not give wrong HintPaths. I have two suggestions for that in the original issue description. I think @chrisasc is working on this now.

SatjaSivcev commented 4 years ago

I think this is fixed now, e.g. https://github.com/zivid/csharp-extra-samples/blob/master/source/Camera/Basic/Capture/Capture.csproj

knatten commented 4 years ago

Yup, we're all good:

👻 git grep HintPath | awk '{print $2}' |sort|uniq
<HintPath>$(ZIVID_INSTALL_FOLDER)\bin_debug\ZividCoreNET.dll</HintPath>
<HintPath>$(ZIVID_INSTALL_FOLDER)\bin_debug\ZividVis3DNET.dll</HintPath>
<HintPath>$(ZIVID_INSTALL_FOLDER)\bin\ZividCoreNET.dll</HintPath>
<HintPath>$(ZIVID_INSTALL_FOLDER)\bin\ZividVis3DNET.dll</HintPath>