Cannot Register Windows.Devices.Bluetooth

bluetooth, c#, dll, windows

Solution

The solution is a combination of everything.

- Add `<TargetPlatformVersion>8.0</TargetPlatformVersion>` to the csproj

- Add 'Windows.winmd' to your references.

- Add C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework.NETFramework\v4.5.1\Facades\System.Runtime.dll to the references.

The default System.Runtime that is part of core does not contain the System.Attribute that the Windows.winmd needs to do anything.

This means that I can now build desktop console applications to work with bluetooth as long as my deployment target is Windows 8.0 and higher.

Problem

I have been trying to register the `Windows.Devices.Bluetooth`, so that I can work with the code found at http://msdn.microsoft.com/en-us/library/windows/apps/windows.devices.bluetooth.rfcomm.aspx Even though I have the SDKs installed from VS 2013 Pro Update 3, and the Windows 8 SDKs, the only place I have found these assemblies is in the C:\Windows\System32 folder. When I try to register them into my project I am getting "A Reference to 'C:\Windows\System32\Windows.Devices.Bluetooth.dll' could not be added. Please make sure that the file is accessible, and that it is a valid assembly or COM component." I have tried this when running VS as admin and without. Anyone else have this issue, and how did you get over this obstacle?

Original source