Urgent

G

Guest

Does anyone have any advise on how I can fix the error message shown below?
Thanks in advance for any ideas,
Shane


Server Error in '/' Application
--------------------------------------------------------------------------------

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

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

Source Error:


Line 42: {
Line 43:
Line 44: Logger.Write("Application_Start");
Line 45:
Line 46: // Initializes various security providers


Source File:
C:\Inetpub\customers\interface\framework\aspnet\baseApplication.cs Line:
44

Stack Trace:


[SecurityException: Requested registry access is not allowed.]
Microsoft.Win32.RegistryKey.OpenSubKey(String name, Boolean writable) +440
System.Diagnostics.EventLog.CreateEventSource(String source, String
logName, String machineName, Boolean useMutex) +443
System.Diagnostics.EventLog.WriteEntry(String message, EventLogEntryType
type, Int32 eventID, Int16 category, Byte[] rawData) +347
System.Diagnostics.EventLog.WriteEntry(String source, String message,
EventLogEntryType type, Int32 eventID, Int16 category, Byte[] rawData) +68
System.Diagnostics.EventLog.WriteEntry(String source, String message,
EventLogEntryType type, Int32 eventID, Int16 category) +21
System.Diagnostics.EventLog.WriteEntry(String source, String message,
EventLogEntryType type, Int32 eventID) +15
System.Diagnostics.EventLog.WriteEntry(String source, String message,
EventLogEntryType type) +11

Microsoft.Practices.EnterpriseLibrary.Logging.Distributor.DistributorEventLogger.WriteToLog(Exception exception, Severity severity)

Microsoft.Practices.EnterpriseLibrary.Logging.Distributor.DistributorEvents.LogProcessLogException(LogEntry logEntry, Exception ex)

Microsoft.Practices.EnterpriseLibrary.Logging.Distributor.LogDistributor.ProcessLog(LogEntry log)

Microsoft.Practices.EnterpriseLibrary.Logging.Distributor.InProcLogDistributionStrategy.SendLog(LogEntry logEntry)

Microsoft.Practices.EnterpriseLibrary.Logging.LogWriter.SendMessage(LogEntry
logEntry)
Microsoft.Practices.EnterpriseLibrary.Logging.LogWriter.Write(LogEntry log)
Microsoft.Practices.EnterpriseLibrary.Logging.Logger.Write(LogEntry log)
Microsoft.Practices.EnterpriseLibrary.Logging.Logger.Write(Object
message, String category, Int32 priority, Int32 eventId, Severity severity,
String title, IDictionary properties)
Microsoft.Practices.EnterpriseLibrary.Logging.Logger.Write(Object message)

PointMethod.Customers.Interface.Web.IFS.framework.aspnet.baseApplication.Application_Start(Object
sender, EventArgs e) in
C:\Inetpub\customers\interface\framework\aspnet\baseApplication.cs:44
 
N

Norman Yuan

It seems you are running a web application that acceses Windows registry.
Obviously, the web app running user account (by default, ASPNET or Network
Services) does not have permission to access the registry key.

It also seems you are using MS Enterprise Library Block. So, you may want to
go through the document to see what user privilege is required for that
piece of code to access that Registry Key.

To solve that, you either give appropriate permission to access the said
registry Key (using RegEdt32.exe); or change the web app user account
(impersonate); or, if you think both are pening a security hole, then,
simply do not use that code and change the logic with your own code.

Shane said:
Does anyone have any advise on how I can fix the error message shown
below?
Thanks in advance for any ideas,
Shane


Server Error in '/' Application.
--------------------------------------------------------------------------------

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

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

Source Error:


Line 42: {
Line 43:
Line 44: Logger.Write("Application_Start");
Line 45:
Line 46: // Initializes various security providers


Source File:
C:\Inetpub\customers\interface\framework\aspnet\baseApplication.cs
Line:
44

Stack Trace:


[SecurityException: Requested registry access is not allowed.]
Microsoft.Win32.RegistryKey.OpenSubKey(String name, Boolean writable)
+440
System.Diagnostics.EventLog.CreateEventSource(String source, String
logName, String machineName, Boolean useMutex) +443
System.Diagnostics.EventLog.WriteEntry(String message, EventLogEntryType
type, Int32 eventID, Int16 category, Byte[] rawData) +347
System.Diagnostics.EventLog.WriteEntry(String source, String message,
EventLogEntryType type, Int32 eventID, Int16 category, Byte[] rawData) +68
System.Diagnostics.EventLog.WriteEntry(String source, String message,
EventLogEntryType type, Int32 eventID, Int16 category) +21
System.Diagnostics.EventLog.WriteEntry(String source, String message,
EventLogEntryType type, Int32 eventID) +15
System.Diagnostics.EventLog.WriteEntry(String source, String message,
EventLogEntryType type) +11

Microsoft.Practices.EnterpriseLibrary.Logging.Distributor.DistributorEventLogger.WriteToLog(Exception
exception, Severity severity)

Microsoft.Practices.EnterpriseLibrary.Logging.Distributor.DistributorEvents.LogProcessLogException(LogEntry
logEntry, Exception ex)

Microsoft.Practices.EnterpriseLibrary.Logging.Distributor.LogDistributor.ProcessLog(LogEntry
log)

Microsoft.Practices.EnterpriseLibrary.Logging.Distributor.InProcLogDistributionStrategy.SendLog(LogEntry
logEntry)

Microsoft.Practices.EnterpriseLibrary.Logging.LogWriter.SendMessage(LogEntry
logEntry)
Microsoft.Practices.EnterpriseLibrary.Logging.LogWriter.Write(LogEntry
log)
Microsoft.Practices.EnterpriseLibrary.Logging.Logger.Write(LogEntry log)
Microsoft.Practices.EnterpriseLibrary.Logging.Logger.Write(Object
message, String category, Int32 priority, Int32 eventId, Severity
severity,
String title, IDictionary properties)
Microsoft.Practices.EnterpriseLibrary.Logging.Logger.Write(Object
message)

PointMethod.Customers.Interface.Web.IFS.framework.aspnet.baseApplication.Application_Start(Object
sender, EventArgs e) in
C:\Inetpub\customers\interface\framework\aspnet\baseApplication.cs:44
 
N

NuTcAsE

MS Enterprise library's default logging provider is the Event Log. When
you write a log entry using Logger.Write ("") without specifying a
category it will use the default logging categor which is "INFO".

The exception occurs when the enterprise lib is trying to write an
entry to the event log, and might be trying to register an event source
with the event log, which will fail as ASPNET account does not have
prevliges to register write to the event source event log key. Options:

1. Change the default log category of the app to not use Event Log.

- OR -

2. Register the event source used by the enterprise library. (You can
find the event source at loggingdistributorconfiguration.config file,
look for the eventLogName and eventSourceName attributes in the xml
file).

You dont need to provide registry permissions to ASPNET for this. The
only thing required is to register the event source.

Hope this helps...

- NuTcAsE
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top