Search code examples
windows-runtimewindows-phonec++-cxwin-universal-appmicrosoft-band

Connecting Microsoft Band SDK Preview to C++ project


I have just downloaded the Microsoft Band SDK Preview and trying to connect it to my C++/CX Windows Universal App project. Nuget gives me an error below, any way I could use the SDK preview from C++ code?

Install-Package : Could not install package 'Microsoft.Band 1.3.10219-preview'. 
You are trying to install this package into a project that targets 'Native,Version=v0.0', 
but the package does not contain any assembly references or content files that are 
compatible with that framework. For more information, contact the package author.
At line:1 char:1
 + Install-Package Microsoft.Band -Pre
 + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 + CategoryInfo          : NotSpecified: (:) [Install-Package], InvalidOperationException
 + FullyQualifiedErrorId : NuGetCmdletUnhandledException,NuGet.PowerShell.Commands.InstallPackageCommand

It seems the problem is generic to installing managed assemblies to C++ projects, but I haven't managed to find the workaround yet.


Solution

  • The Band SDK Preview (1.3.10219-preview) NuGet package does not specifically target Windows Runtime Components, which means it cannot be consumed (directly) by C++ or JavaScript Windows Runtime Component libraries. As an alternative, you could create a Windows Runtime Component library (C# or VB) that wraps the portion of the Band SDK you need and then consume that library from your C++ or JavaScript component.