An unhandled exception of type 'System.Security.SecurityException' occurred in mscorlib.dll Addition

  • Thread starter Thread starter Ankit Aneja
  • Start date Start date
A

Ankit Aneja

This is my problem. I am using Visual 2003, .Net framework 1.1 and the
Application Block
I configured the DAAB using the Enterprise Library Configuration

now this is the error which is coming



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:




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)
System.Diagnostics.EventLog.SourceExists(String source, String machineName)
System.Diagnostics.EventLog.WriteEntry(String message, EventLogEntryType
type, Int32 eventID, Int16 category, Byte[] rawData)
System.Diagnostics.EventLog.WriteEntry(String message, EventLogEntryType
type, Int32 eventID, Int16 category)
System.Diagnostics.EventLog.WriteEntry(String message, EventLogEntryType
type, Int32 eventID)
System.Diagnostics.EventLog.WriteEntry(String message, EventLogEntryType
type)
Microsoft.Practices.EnterpriseLibrary.Common.Instrumentation.PerformanceCounte
rInstances.ReportCounterFailure(String message)
Microsoft.Practices.EnterpriseLibrary.Common.Instrumentation.PerformanceCounte
rInstances..ctor(String categoryName, String counterName, Boolean
createNewInstance)
Microsoft.Practices.EnterpriseLibrary.Common.Instrumentation.InstrumentedEvent
..AddPerformanceCounter(String category, String[] counterNames, Boolean
createNewInstance)
Microsoft.Practices.EnterpriseLibrary.Common.Instrumentation.InstrumentedEvent
..Initialize(String counterCategory, String[] counterNames, Boolean
createNewInstance, String eventLogSource, EventLogIdentifier[] eventIds)
Microsoft.Practices.EnterpriseLibrary.Common.Instrumentation.InstrumentedEvent
...ctor(String counterCategory, String[] counterNames, Boolean
createNewInstance)
Microsoft.Practices.EnterpriseLibrary.Data.Instrumentation.DataServiceEvent..c
tor(String[] counterNames)
Microsoft.Practices.EnterpriseLibrary.Data.Instrumentation.DataCommandFailedEv
ent..ctor(String[] counterNames)
Microsoft.Practices.EnterpriseLibrary.Data.Instrumentation.DataCommandFailedEv
ent..cctor()
 
You are getting this error at run-time or in development environment?

VJ

Ankit Aneja said:
This is my problem. I am using Visual 2003, .Net framework 1.1 and the
Application Block
I configured the DAAB using the Enterprise Library Configuration

now this is the error which is coming



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:




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)
System.Diagnostics.EventLog.SourceExists(String source, String
machineName)
System.Diagnostics.EventLog.WriteEntry(String message, EventLogEntryType
type, Int32 eventID, Int16 category, Byte[] rawData)
System.Diagnostics.EventLog.WriteEntry(String message, EventLogEntryType
type, Int32 eventID, Int16 category)
System.Diagnostics.EventLog.WriteEntry(String message, EventLogEntryType
type, Int32 eventID)
System.Diagnostics.EventLog.WriteEntry(String message, EventLogEntryType
type)
Microsoft.Practices.EnterpriseLibrary.Common.Instrumentation.PerformanceCounte
rInstances.ReportCounterFailure(String message)
Microsoft.Practices.EnterpriseLibrary.Common.Instrumentation.PerformanceCounte
rInstances..ctor(String categoryName, String counterName, Boolean
createNewInstance)
Microsoft.Practices.EnterpriseLibrary.Common.Instrumentation.InstrumentedEvent
.AddPerformanceCounter(String category, String[] counterNames, Boolean
createNewInstance)
Microsoft.Practices.EnterpriseLibrary.Common.Instrumentation.InstrumentedEvent
.Initialize(String counterCategory, String[] counterNames, Boolean
createNewInstance, String eventLogSource, EventLogIdentifier[] eventIds)
Microsoft.Practices.EnterpriseLibrary.Common.Instrumentation.InstrumentedEvent
..ctor(String counterCategory, String[] counterNames, Boolean
createNewInstance)
Microsoft.Practices.EnterpriseLibrary.Data.Instrumentation.DataServiceEvent..c
tor(String[] counterNames)
Microsoft.Practices.EnterpriseLibrary.Data.Instrumentation.DataCommandFailedEv
ent..ctor(String[] counterNames)
Microsoft.Practices.EnterpriseLibrary.Data.Instrumentation.DataCommandFailedEv
ent..cctor()
 
at run time
and its running fine on other machine
Vijay said:
You are getting this error at run-time or in development environment?

VJ

Ankit Aneja said:
This is my problem. I am using Visual 2003, .Net framework 1.1 and the
Application Block
I configured the DAAB using the Enterprise Library Configuration

now this is the error which is coming



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:




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)
System.Diagnostics.EventLog.SourceExists(String source, String
machineName)
System.Diagnostics.EventLog.WriteEntry(String message, EventLogEntryType
type, Int32 eventID, Int16 category, Byte[] rawData)
System.Diagnostics.EventLog.WriteEntry(String message, EventLogEntryType
type, Int32 eventID, Int16 category)
System.Diagnostics.EventLog.WriteEntry(String message, EventLogEntryType
type, Int32 eventID)
System.Diagnostics.EventLog.WriteEntry(String message, EventLogEntryType
type)
Microsoft.Practices.EnterpriseLibrary.Common.Instrumentation.PerformanceCounte
rInstances.ReportCounterFailure(String message)
Microsoft.Practices.EnterpriseLibrary.Common.Instrumentation.PerformanceCounte
rInstances..ctor(String categoryName, String counterName, Boolean
createNewInstance)
Microsoft.Practices.EnterpriseLibrary.Common.Instrumentation.InstrumentedEvent
.AddPerformanceCounter(String category, String[] counterNames, Boolean
createNewInstance)
Microsoft.Practices.EnterpriseLibrary.Common.Instrumentation.InstrumentedEvent
.Initialize(String counterCategory, String[] counterNames, Boolean
createNewInstance, String eventLogSource, EventLogIdentifier[] eventIds)
Microsoft.Practices.EnterpriseLibrary.Common.Instrumentation.InstrumentedEvent
..ctor(String counterCategory, String[] counterNames, Boolean
createNewInstance)
Microsoft.Practices.EnterpriseLibrary.Data.Instrumentation.DataServiceEvent..c
tor(String[] counterNames)
Microsoft.Practices.EnterpriseLibrary.Data.Instrumentation.DataCommandFailedEv
ent..ctor(String[] counterNames)
Microsoft.Practices.EnterpriseLibrary.Data.Instrumentation.DataCommandFailedEv
ent..cctor()
 
Ankit said:
This is my problem. I am using Visual 2003, .Net framework 1.1 and the
Application Block
I configured the DAAB using the Enterprise Library Configuration

now this is the error which is coming



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:




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)
System.Diagnostics.EventLog.SourceExists(String source, String machineName)
System.Diagnostics.EventLog.WriteEntry(String message, EventLogEntryType
type, Int32 eventID, Int16 category, Byte[] rawData)
System.Diagnostics.EventLog.WriteEntry(String message, EventLogEntryType
type, Int32 eventID, Int16 category)
System.Diagnostics.EventLog.WriteEntry(String message, EventLogEntryType
type, Int32 eventID)
System.Diagnostics.EventLog.WriteEntry(String message, EventLogEntryType
type)
Microsoft.Practices.EnterpriseLibrary.Common.Instrumentation.PerformanceCounte
rInstances.ReportCounterFailure(String message)
Microsoft.Practices.EnterpriseLibrary.Common.Instrumentation.PerformanceCounte
rInstances..ctor(String categoryName, String counterName, Boolean
createNewInstance)
Microsoft.Practices.EnterpriseLibrary.Common.Instrumentation.InstrumentedEvent
.AddPerformanceCounter(String category, String[] counterNames, Boolean
createNewInstance)
Microsoft.Practices.EnterpriseLibrary.Common.Instrumentation.InstrumentedEvent
.Initialize(String counterCategory, String[] counterNames, Boolean
createNewInstance, String eventLogSource, EventLogIdentifier[] eventIds)
Microsoft.Practices.EnterpriseLibrary.Common.Instrumentation.InstrumentedEvent
..ctor(String counterCategory, String[] counterNames, Boolean
createNewInstance)
Microsoft.Practices.EnterpriseLibrary.Data.Instrumentation.DataServiceEvent..c
tor(String[] counterNames)
Microsoft.Practices.EnterpriseLibrary.Data.Instrumentation.DataCommandFailedEv
ent..ctor(String[] counterNames)
Microsoft.Practices.EnterpriseLibrary.Data.Instrumentation.DataCommandFailedEv
ent..cctor()
hi,
The problem have encountered was faced by me back in January. I was
also doubtful abt the solution. But after analyzing , i found that
running "Install Services" in the Enterprise library will solve the
problem. This batch file edit the registry entries. I hope this may
solve ur problem.

Regards,
Sandeep
 
Back
Top