Search code examples
c#visual-studiodllkinectsetup-project

Kinect camera not working after installing my visual studio setup project


I have a project in Visual Studio that uses the Microsoft Azure Kinect Camera. My program runs perfectly fine when I debug it and I can install it just fine. However, when I try to run my application, there is an exception for the Kinect camera. All the DLLs seem to appear in the application's files after installation, so I have no idea what the issue could be. I know the camera is connected properly because it runs in debug mode. There are a few DLLs I had to add manually into the file system in the setup project, but I copied over the whole folder so I don't think there is anything I am missing. These DLLs I added pop up as just files and not assembly files like the other ones, but I tried adding them as assembly files and they still popped up as normal file types.

I have a folder within my project called OpenGL which includes these files https://github.com/microsoft/Azure-Kinect-Samples/tree/master/body-tracking-samples/csharp_3d_viewer

Another note I might add is that my program installs just on the C: drive. It does not install in Program Files. Not sure if this causes any issues, but I am not an administrator so it won't let me install my application there.

This is the portion of code the error seems to be happening:

 // setup the Sensor calibration
    m_SensorCalibration = m_Device.GetCalibration();
    try
    {
        // Setup the caching area for points found while tracking
        PointCloud.ComputePointCloudCache(m_Device.GetCalibration());
    }
    catch (Exception e)
    {
        String alertMsg = e.ToString();
        String alertTitle = "Compute Point Cloud Cache failed.";
        MessageBox.Show(alertMsg, alertTitle, MessageBoxButtons.OK, MessageBoxIcon.Warning);
    }

This is what pops up after installing and trying to run the application. Picture of Error Message


Solution

  • The added dlls for the kinect included one called k4a.dll. It was 635KB. I decided to compare my file sizes to an older version of my application and saw that this older file was 637KB. I replaced my file with the older version, rebuilt the installer, installed my application, and it works!