Question

I'm an absolute beginner when it comes to Visual Studio and C#. However they would seem like the best entry point for dealing with the Microsoft Kinect.

I'm currently following the tutorials on ch9, and I've managed to fix each issue that has arisen (these tutorials assume a certain familiarity with C# and VS2010 which I lack) until now.

I am trying to add the KinectSensorChooser Control to my MainWindow WPF (please correct my terminology if I'm muddling this), however it will not drag onto the screen, I get the "you can't do that" cursor. I can however drag and drop all the standard VS controls onto the page.

If I use the sample code:

<Window x:Class="SettingUpDevEnvironment.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        Title="MainWindow" Height="350" Width="525" Loaded="Window_Loaded" 
        xmlns:my="clr-namespace:Microsoft.Samples.Kinect.WpfViewers;assembly=Microsoft.Samples.Kinect.WpfViewers" Closing="Window_Closing">
    <Grid>
        <my:KinectSensorChooser HorizontalAlignment="Left" Margin="92,130,0,0" Name="kinectSensorChooser1" VerticalAlignment="Top" Width="330" KinectSensorChanged="kinectSensorChooser1_KinectSensorChanged" />
    </Grid>
</Window>

I get these errors:

'Unable to load the metadata for assembly 'Microsoft.Samples.Kinect.WpfViewers'. This assembly may have been downloaded from the web. See http://go.microsoft.com/fwlink/?LinkId=179545. The following error was encountered during load: Could not load file or assembly 'Microsoft.Samples.Kinect.WpfViewers, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. The system cannot find the file specified. C:\Program Files\Microsoft SDKs\Kinect\v1.0\KinectforWindowsSDKV1\2.Setting Up Dev Environment\SettingUpDevEnvironment\SettingUpDevEnvironment\MainWindow.xaml'

(the file in question is at that location)

'my:KinectSensorChooser' was not found. Verify that you are not missing an assembly reference and that all referenced assemblies have been built

Searching the Google hasn't really given me much help, so I'm hoping I can get some assistance here.

Was it helpful?

Solution

When downloading DLL files from the internet, right click on them and select properties. On the first tab you'll see an unblock button which will remove the restrictions. This is a security mechanism built into Windows.

OTHER TIPS

FYI:

First: If you get all this as a .zip file then UNBLOCK the .zip BEFORE unzipping

Also, It seems you also cannot have the files on a network drive. Not sure if that is just me but it is very annoying!

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top