So I was writing an application that requires access to the registry. I had not touched any build settings, wanting to get the thing working before I added the other touches
I have the same problem s I resolve it by unchecking the "Enable ClickOnce security settings" To Find this option in Visual Studio Right Click on your Project ==>properties==>Select Security==> Enable ClickOnce security settings (This option was already checked so I unchecked it and my problem get resolved).