I am getting an UnauthorizedAccessException (see stack trace below) when I try to use BluetoothSecurity.RemoveDevice() to remove a pairing that I originally created using BluetoothSecurity.PairRequest().
The PairRequest works fine, it's only the call to RemoveDevice that is giving me trouble. My application is using the Sample Privileged Developer key that comes with the WM6 SDK, so I should have full administrator access to the device. Also, I discovered that I can programatically remove the pairing from the registry with no problem.
The WM device is an HTC Touch which uses WM6 and the Microsoft Bluetooth stack. I am developing with Visual Studio 2005 with the WM6 SDK.
I noticed that someone else posted a similar problem but there haven't been any suggestions posted yet. Any thoughts would be appreciated! Thanks.
"at System.ThrowHelper.ThrowUnauthorizedAccessException()\r\nat Microsoft.Win32.RegistryKey.EnsureWriteable()\r\nat Microsoft.Win32.RegistryKey.DeleteSubKeyTree()\r\nat InTheHand.Net.Bluetooth.BluetoothSecurity.RemoveDevice()\r\nat BluetoothInterloper.MainForm.MainForm_Load()\r\nat System.Windows.Forms.Form.OnLoad()\r\nat System.Windows.Forms.Form._SetVisibleNotify()\r\nat System.Windows.Forms.Control.set_Visible()\r\nat System.Windows.Forms.Application.Run()\r\nat BluetoothInterloper.Program.Main()\r\n"