1
I have a Surface Pro 3, running Window 10 Pro, version 1803. One of the things that I do with this tablet is play around with the new API and programming features that Microsoft provides.
Recently, I was test some small toy programs using the sensor API to get a feel for them. I have a small program that enumerates all the sensors on the device, worked find on an older surface tablet, running 8.1. However when I brought the source code over to the Surface Pro, recompiled it and when to run it I got the error:
"Unable to CoCreateInstance() on SensorManger error: This program is blocked by group policy. For more information contact your system administrator"
I get this error regardless if I run as myself or as an administrator. Due to this being test code, I never bother to do anything robust error handling so this error does not cause the program to abort, so the program continues and shows a GUI with no sensor discovered obviously.
This device is a personal stand-alone device, not attached to a domain controller. Under developers, I have selected "sideload apps".
My question is, how do I troubleshoot / fix the above error?
A second, related, question with this being a stand-alone computer do I really need Group Policy, and if not is there some way to disable it
Thanks
I googled that error message, and literally every site told me the first thing to look for is a virus/malware infection. You should do that first. After that, do the search yourself and go through the other dozen or so possibilities. If you exhaust all of those, go back to your program and add debugging code. – Michael Hampton – 2019-03-11T02:16:28.327
@Biswapriyo Yes, I have the code (I wrote it - it is my first attempt at using the new sensor API). As I mentioned in my original question, the code works correctly on a Windows 8.1 system listing the available sensors. It, however fails with the reported error on a Windows 10 system – thurizas – 2019-03-11T10:42:49.313
@Biswapriyo I'm hoping you will post the solution. (or if you have I'm not seeing it for some reason) – thurizas – 2019-03-11T13:49:04.960