When debugging with EnterpriseLibrary today, the following error occurred:
Security exception: The current application security level cannot modify the requested registry value.
The solution is as follows:
Open the Machine.config file under C:WINDOWSMicrosoft.NETFrameworkv1.1.4322CONFIG and find the following node:
<identity impersonate="false" userName="" password=""/>
Modify to:
<identity impersonate="true" userName="Administrator" password=""/>
No need to restart the machine.