none
Trouble with the Fusion 2.o libraries RRS feed

  • Question

  • Hi,

    There seems to be some libraries missing when I try to run Fusion from managed code. I have a project with a reference to Microsoft.Kinect.Fusion.dll. The solution compile and starts fine until it tries to load Microsoft.Kinect.Fusion.dll it then complains that it fails to load Kinect20.Fusion.dll, which I suppose is the native library. I get the same issues when use the NuGet package to setup Fusion. 

    I notice that the KinectFusionExplorer sample has a different project configuration that actually have target folders with the Kinect20.Fusion.dll in them.  That sample also have the managed source code included in the solution.

    I managed to work around this issue by simply copying the x86 and x64 target folders into my Debug and Release folders but this seems to be an ugly solution that will be hard to maintain. Is there another way I should solve this? I would prefer if I could just refer to the registered dll's in my project.

    Regards,

    /Peter 

    Friday, December 5, 2014 11:57 AM

Answers

  • If you use a text editor you can modify the .csproj file and include the following between the <Project /> tags:

      <Target Name="AfterBuild">
        <Copy Condition="'$(Platform)' == 'x86'" SourceFiles="$(KINECTSDK20_DIR)Redist\Fusion\x86\Kinect20.Fusion.dll" DestinationFolder="$(OutputPath)">
        </Copy>
        <Copy Condition="'$(Platform)' == 'x64'" SourceFiles="$(KINECTSDK20_DIR)Redist\Fusion\x64\Kinect20.Fusion.dll" DestinationFolder="$(OutputPath)">
        </Copy>
        <Copy Condition="'$(Platform)' == 'AnyCPU'" SourceFiles="$(KINECTSDK20_DIR)Redist\Fusion\x64\Kinect20.Fusion.dll" DestinationFolder="$(OutputPath)\x64">
        </Copy>
        <Copy Condition="'$(Platform)' == 'AnyCPU'" SourceFiles="$(KINECTSDK20_DIR)Redist\Fusion\x86\Kinect20.Fusion.dll" DestinationFolder="$(OutputPath)\x86">
        </Copy>
      </Target>

    The alternative is to add Post-build event script to do an XCOPY command:

    for x64 build:
    xcopy "$(KINECTSDK20_DIR)Redist\Fusion\x64\Kinect20.Fusion.dll" "$(TargetDir)" /S /R /Y /I


    Carmine Sirignano - MSFT

    Friday, December 5, 2014 7:20 PM

All replies

  • If you use a text editor you can modify the .csproj file and include the following between the <Project /> tags:

      <Target Name="AfterBuild">
        <Copy Condition="'$(Platform)' == 'x86'" SourceFiles="$(KINECTSDK20_DIR)Redist\Fusion\x86\Kinect20.Fusion.dll" DestinationFolder="$(OutputPath)">
        </Copy>
        <Copy Condition="'$(Platform)' == 'x64'" SourceFiles="$(KINECTSDK20_DIR)Redist\Fusion\x64\Kinect20.Fusion.dll" DestinationFolder="$(OutputPath)">
        </Copy>
        <Copy Condition="'$(Platform)' == 'AnyCPU'" SourceFiles="$(KINECTSDK20_DIR)Redist\Fusion\x64\Kinect20.Fusion.dll" DestinationFolder="$(OutputPath)\x64">
        </Copy>
        <Copy Condition="'$(Platform)' == 'AnyCPU'" SourceFiles="$(KINECTSDK20_DIR)Redist\Fusion\x86\Kinect20.Fusion.dll" DestinationFolder="$(OutputPath)\x86">
        </Copy>
      </Target>

    The alternative is to add Post-build event script to do an XCOPY command:

    for x64 build:
    xcopy "$(KINECTSDK20_DIR)Redist\Fusion\x64\Kinect20.Fusion.dll" "$(TargetDir)" /S /R /Y /I


    Carmine Sirignano - MSFT

    Friday, December 5, 2014 7:20 PM
  • Thanks Carmine!

    Now it works.

    /Peter

    Friday, December 5, 2014 9:44 PM