Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice
  4. Dismiss Notice

Cant build project from Unity 5 using the Kinect for Windows store

Discussion in 'Windows' started by deltron1830, Jul 20, 2015.

  1. deltron1830

    deltron1830

    Joined:
    Mar 20, 2013
    Posts:
    27
    I am trying to build a project in Unity3D which uses the Kinect v2 for The Windows store. To build a windows store app from unity it 1st builds a visual studio project from which you then build the final app. I am getting errors when I try to build the visual studio project.
    Some guys seem to have figured it out for Unity 4 here, Though I have tried everything they suggested and read through all the posts and links in great detail yet I am still having the same error.

    Here is my error
    "
    First-chance exception at 0x76004598 in Template.exe: Microsoft C++ exception: Platform::ClassNotRegisteredException ^ at memory location 0x0643F1C0. HRESULT:0x80040154 Class not registered

    WinRT information: Class not registered

    Stack trace:
    combase.dll!76727455()
    vccorlib120_app.dll!5003a438()
    vccorlib120_app.dll!5003b337()
    KinectUnityAddin.dll!50061296()
    KinectUnityAddin.dll!500745af()
    KinectUnityAddin.dll!50062eef()

    If there is a handler for this exception, the program may be safely continued.
    "
     
  2. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    10,506
    Which VS version are you on?
     
  3. deltron1830

    deltron1830

    Joined:
    Mar 20, 2013
    Posts:
    27
    I've tried these two versions of VS
    vs2013version.PNG
    vs2015version.PNG
     
  4. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    10,506
    Which steps did you try from the other thread? You're probably missing references in project and manifest.
     
  5. deltron1830

    deltron1830

    Joined:
    Mar 20, 2013
    Posts:
    27
    So the last post there gives the instructions which I have followed [I'll add my own interpretation + additional info in square brackets]

    To get my Unity app with the Kinect package to export and work in windows store I do this...
    -In Unity build project as 8.1 w/ C# projects
    [SDK is set to 8.1 and I tick the box for Unity c# Projects, also in Unity 5 I set the dll in the metro folder to build for WSAPlayer and set others for editor /standalone]
    -Make sure apppackage.manifest has webcam and mic capabilities
    [I tick webcam and mic in player settings, publishing settings, capabilities ]
    -Add references to KinectPreview extension to the two supporting projects in my solution
    [I add a reference to this file.
    C:\Program Files (x86)\Microsoft SDKs\Windows\v8.1\ExtensionSDKs\WindowsPreview.Kinect\2.0\References\CommonConfiguration\neutral\WindowsPreview.Kinect.winmd
    to the two projects..
    Assembly-CSharp-metro-vs2013
    and
    Assembly-CSharp-firstpass-metro-vs2013
    ]
    -Change build configuration to x86 on the two supporting projects and in the configuration manager
    [If I set the active solution platforms to x86 in the dropdown box in the menu bar of visual studio the projects also change to x86]
    -Run and smile
    [run, get same error, do not smile :( ]
     
  6. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    10,506
    This is wrong. You're supposed to add those references to the main project Unity generates, not the ones that have your scripts. It will be named after your project.
     
  7. deltron1830

    deltron1830

    Joined:
    Mar 20, 2013
    Posts:
    27
    Ok When i do that I get 21 errors and 1180 warnings
    Two of the errors look like this

    Severity Code Description Project File Line
    Error The command ""C:\BUILDS\Help2\Unity\Tools\SerializationWeaver\SerializationWeaver.exe" "C:\Github\MS_Kinect\obj\Store 8.1\x86\Debug\x86\Debug\Assembly-CSharp-firstpass.dll" -pdb -verbose -unity-engine="C:\BUILDS\Help2\MSKinect\Unprocessed\UnityEngine.dll" "C:\Github\MS_Kinect\obj\Store 8.1\x86\Debug\x86\Debug"" exited with code 1. Assembly-CSharp-firstpass-metro-vs2013 C:\Github\MS_Kinect\Assembly-CSharp-firstpass-metro-vs2013.csproj 135

    Severity Code Description Project File Line
    Error The command ""C:\BUILDS\Help2\Unity\Tools\SerializationWeaver\SerializationWeaver.exe" "C:\Github\MS_Kinect\obj\Store 8.1\x86\Debug\x86\Debug\Assembly-CSharp.dll" -pdb -verbose -unity-engine="C:\BUILDS\Help2\MSKinect\Unprocessed\UnityEngine.dll" "C:\Github\MS_Kinect\obj\Store 8.1\x86\Debug\x86\Debug"" exited with code 1. Assembly-CSharp-metro-vs2013 C:\Github\MS_Kinect\Assembly-CSharp-metro-vs2013.csproj 140

    and the others look like this..

    Severity Code Description Project File Line
    Error Cannot resolve Assembly or Windows Metadata file 'WindowsPreview.Data.winmd' MSKinect C:\BUILDS\Help2\MSKinect\MSKinect.csproj

    Btw one weird thing I noticed in VS 2015 is that in the properties of the WindowsPreview.Kinect reference, when added to the project, in its properties its Version is 255.255.255.255 which seems odd.

    Also the project I am trying to build is the example Unity / Kinect project provided by Microsoft
     
  8. deltron1830

    deltron1830

    Joined:
    Mar 20, 2013
    Posts:
    27
    Thanks a lot for looking at this issue btw @Tautvydas Zilys . I dont think I've ever had a "Unity Technlogies" reply before.
    I was thinking what would be a great help would be if you could confirm that you can successfully build the Microsoft Kinect Unity example project from Unity 5 to Windows store yourself. And if so post more detailed instruction on how to do so. In that case I will know what I'm supposed to do in order to get it to work and can work towards that.
     
  9. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    10,506
    The error is fairly self explaining: it cannot find WindowsPreview.Data.winmd - is the file on disk?

    One more thing: when building from Unity, uncheck C# projects. They are known to cause issues with plugins: we have an active bug on them.
     
  10. deltron1830

    deltron1830

    Joined:
    Mar 20, 2013
    Posts:
    27
    I sorted this issue btw..
    The issue was I was adding the references wrong. I was going- add reference\browse and then would browse to and select the .winmd file
    eg. C:\Program Files (x86)\Microsoft SDKs\Windows\v8.1\ExtensionSDKs\WindowsPreview.Kinect\2.0\References\CommonConfiguration\neutral\WindowsPreview.Kinect.winmd
    The correct way to add the reference is to go- add reference\Windows8.1\Extensions\ then tick the box for the required reference assembly.
    Thanks for your help!
     
  11. deltron1830

    deltron1830

    Joined:
    Mar 20, 2013
    Posts:
    27
    The build process for Unity 5 is simpler than the one worked out by the guys for Unity 4 here

    1. Set up the dll in metro folder to build for WSAPlayer
    2. Tick microphone and webcam boxes in player settings, publishing settings, capabilities
    3. Build for windows 8.1 (do *not* tick C# project box)
    4. One project will be created in the VS solution. Right click on references\ add reference\Windows8.1\Extensions\ then tick the box for WindowsPreview.Kinect (x86 windows 8.1 version)