This error occurs
''System.Security.SecurityException: Requested registry access is not allowed.
at System.ThrowHelper.ThrowSecurityException(ExceptionResource resource)''
when I try to add a key to Registry. I mention that application requestedExecutionLevel is "requireAdministrator". It's a better ideea to enable ClickOnce security settings and leave requestedExecutionLevel ''asinvoker"?
This is the structure of the VB.NET code:
Try
[my code]
Catch sec As Security.SecurityException
[another block of code]
Catch ex As Exception
[another block of code]
End Try
Is it a better idea to use 'on error resume next' statement? Please explain to me why this error occurs?
VB.NET, Visual Studio 2008 (error occurs on Vindows Vista Ultimate x86 and Windows 7 Ultimate x64, and i was logged in on Administrator account)