help.axcms.netAxinom Logo
Save Save Chapter Send Feedback

KB10031: System.Security.SecurtyException

If the ExceptionPublisher is not configured correctly or there are no active ExceptionPublishers, an exeption occurs

SYMPTOMS

ExceptionManagement is configured through web.config (for example to send the exceptions per mail) but the ExceptionPublisherthrows an exception itself.

The exception:

Security Exception

Description: The application attempted to perform an operation not allowed by the security policy. To grant this application the required permissions please contact your system administrator or change the applications’s trust level in the configuration file.

Exception Details: System.Security.SecurtyException: Requested registry access is not allowed.

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

Stack trace:

[SecurityException: Requested registry access is not allowed.]
Microsoft.Win32.RegistryKey.OpenSubKey(String name, Boolean writable) +473
System.Diagnostics.EventLog.FindSourceRegistration(String source, String machineName, Boolean readOnly) +295
System.Diagnostics.EventLog.SourceExists(String source, String machineName) +78
System.Diagnostics.EventLog.SourceExists(String source) +11
Microsoft.ApplicationBlocks.ExceptionManagement.DefaultPublisher.VerifyValidSource()

CAUSE

The ExceptionPublisher is not configured correctly or there are no active ExceptionPublishers, so the DefaultExceptionPublisher from Microsoft starts and tries to save the Exception to a EventLog, but the application has no permissions to do so

SOLUTION

To give the application permissons to write into EventLog issue the following command:
C:\Windows\Microsoft.NET\Framework\v2.0.50727\installutil c:\projects\AxCMS\Components\Components\Microsoft.ApplicationBlocks.ExceptionManagement.dll

MORE INFORMATION

Read here more about exception management: http://en.help.axcms.net/en_help_cms_inst_exmngmnt.AxCMS

APPLIES TO

AxCMS.net versions: All versions