You will get this exception if you try to debug on a physical device from Visual Studio and haven’t install the debug certificates.
“Connection failed. The device security configuration disallowed the connection. Ensure that you have the appropriate certificates on your device for development. Review your SDK documentation for proper security settings for connecting to this device.”
Do the following to solve this:
1. Connect your device via USB.
2. Copy VSDCerts.cab from C:\Program Files\Microsoft Visual Studio 9.0\SmartDevices\SDK\SDKTools to the root of your device in Windows Explorer.
3. Using File Explorer on your device open the VSDCerts.cab file
4. Try debugging from Visual Studio again.
The cab will be installed and you are now ready to debug from Visual Studio.