Kinect V2 Exception in VisualGestureBuilderDatabase


We have a problem with the Kinect V2. We use Google and the Microsoft documentation to find a solution but we found nothing.

We get a Exception when we try to load the gesture from the database:

private readonly string gestureDatabase = @"Database\ChiMoGestures.gbd";

. . .

    VisualGestureBuilderDatabase database = new VisualGestureBuilderDatabase(this.gestureDatabase)

When the program comes to this position,it throws a System.InvalidOperationException , exactly:

An unhandled exception of type 'System.InvalidOperationException' occurred in Microsoft.Kinect.VisualGestureBuilder.dll

Additional information: This API has returned an exception from an HRESULT: 0x80004005

Maybe the database self is not correct but we got it with the VisualgestureBuilder?

I am glad if anyone has a solution for this problem?

asked on Stack Overflow May 4, 2015 by MBIStudent • edited May 4, 2015 by Saagar Elias Jacky

2 Answers


Not sure if this is relevant since the question is quite old, but I will answer it anyway.

The Visual Gesture Builder dll is throwing this error because it is missing some files it needs to work. Specifically, it needs the dlls of the two algorithms that perform the gesture recognition - AdaBoost and RFRProgress. These two dlls are available under your Kinect SDK folder, usually located at:

C:\Program Files\Microsoft SDKs\Kinect\v2.0_1409\Redist\VGB\x86\vgbtechs


C:\Program Files\Microsoft SDKs\Kinect\v2.0_1409\Redist\VGB\x64\vgbtechs

depending on your platform.

Luckily, there is a way to automate this process via Post-build command in Visual Studio. Go to Project -> Properties -> Build Events -> Edit Post-build ...

and paste

xcopy "$(KINECTSDK20_DIR)Redist\VGB\$(Platform)\vgbtechs" "$(TargetDir)\vgbtechs" /S /R /Y /I

This will ensure that you have the dlls in your Build directory no matter what your platform setting is.

answered on Stack Overflow Jun 10, 2015 by Levko Ivanchuk

In addition to the previous comment you must have your database added to your project solution and click on the database inside the solution and set its Copy to Output Directory property to Copy always and Build Action property to Content

answered on Stack Overflow Jan 8, 2021 by Javier JM

User contributions licensed under CC BY-SA 3.0