473,240 Members | 1,447 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,240 software developers and data experts.

An unhandled exception of type 'System.Security.SecurityException' occurred in mscorlib.dll Additional information: Requested registry access is not allowed.

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.Instr umentation.PerformanceCounte
rInstances.ReportCounterFailure(String message)
Microsoft.Practices.EnterpriseLibrary.Common.Instr umentation.PerformanceCounte
rInstances..ctor(String categoryName, String counterName, Boolean
createNewInstance)
Microsoft.Practices.EnterpriseLibrary.Common.Instr umentation.InstrumentedEvent
..AddPerformanceCounter(String category, String[] counterNames, Boolean
createNewInstance)
Microsoft.Practices.EnterpriseLibrary.Common.Instr umentation.InstrumentedEvent
..Initialize(String counterCategory, String[] counterNames, Boolean
createNewInstance, String eventLogSource, EventLogIdentifier[] eventIds)
Microsoft.Practices.EnterpriseLibrary.Common.Instr umentation.InstrumentedEvent
...ctor(String counterCategory, String[] counterNames, Boolean
createNewInstance)
Microsoft.Practices.EnterpriseLibrary.Data.Instrum entation.DataServiceEvent..c
tor(String[] counterNames)
Microsoft.Practices.EnterpriseLibrary.Data.Instrum entation.DataCommandFailedEv
ent..ctor(String[] counterNames)
Microsoft.Practices.EnterpriseLibrary.Data.Instrum entation.DataCommandFailedEv
ent..cctor()
Apr 5 '06 #1
5 9728
Hi Ankit,

Thank you for posting.

From your description, I understand that you have an ASP.NET web
application which use the enterprise library and DAAB. However, at runtime,
you're encountering some System.SecurityException, correct?

Based on the error message and callstack, the exception occured when the
code try accessing certain windows registry entry. So this is a security
permission problem. I suggest you try the following steps first:

1. Change your ASP.NET application's process idenitity to LOCAL SYSTEM and
run it to see whether the problem still occurs. If still occurs, that means
this is not a raw windows security issue, but a .NET code access security
issue. If the problem go away, we need to check the original process
identity's windows permission to the registry.

2. If we've confirmed that this is a .NET CAS issue through #1, we need to
check our asp.net application's Trust Level first, is your ASP.NET
application running under "Full" trustlevel? The trust level can be
configured in the web.config(or machine.config) through the <trust> element:

#trust Element (ASP.NET Settings Schema)
http://msdn2.microsoft.com/en-us/lib...93(VS.80).aspx

If the original value is not set as "Full" , you can manually set the
application's Trust level to "Full", like below:

<trust
level="Full"
/>
After that, test the application again to see whether it can run
correctly(access the registry correctly).

Hope this helps.

Regards,

Steven Cheng
Microsoft Online Community Support
==================================================

When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.

==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)



Apr 6 '06 #2
can u give me steps how i will perform the first step
code id running fine on other system
"Steven Cheng[MSFT]" <st*****@online.microsoft.com> wrote in message
news:6Q**************@TK2MSFTNGXA01.phx.gbl...
Hi Ankit,

Thank you for posting.

From your description, I understand that you have an ASP.NET web
application which use the enterprise library and DAAB. However, at
runtime,
you're encountering some System.SecurityException, correct?

Based on the error message and callstack, the exception occured when the
code try accessing certain windows registry entry. So this is a security
permission problem. I suggest you try the following steps first:

1. Change your ASP.NET application's process idenitity to LOCAL SYSTEM and
run it to see whether the problem still occurs. If still occurs, that
means
this is not a raw windows security issue, but a .NET code access security
issue. If the problem go away, we need to check the original process
identity's windows permission to the registry.

2. If we've confirmed that this is a .NET CAS issue through #1, we need to
check our asp.net application's Trust Level first, is your ASP.NET
application running under "Full" trustlevel? The trust level can be
configured in the web.config(or machine.config) through the <trust>
element:

#trust Element (ASP.NET Settings Schema)
http://msdn2.microsoft.com/en-us/lib...93(VS.80).aspx

If the original value is not set as "Full" , you can manually set the
application's Trust level to "Full", like below:

<trust
level="Full"
/>
After that, test the application again to see whether it can run
correctly(access the registry correctly).

Hope this helps.

Regards,

Steven Cheng
Microsoft Online Community Support
==================================================

When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.

==================================================
This posting is provided "AS IS" with no warranties, and confers no
rights.

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)


Apr 6 '06 #3
i also tried this line
<identity impersonate="false" />
in web.comfig but doesn't work

"Steven Cheng[MSFT]" <st*****@online.microsoft.com> wrote in message
news:6Q**************@TK2MSFTNGXA01.phx.gbl...
Hi Ankit,

Thank you for posting.

From your description, I understand that you have an ASP.NET web
application which use the enterprise library and DAAB. However, at
runtime,
you're encountering some System.SecurityException, correct?

Based on the error message and callstack, the exception occured when the
code try accessing certain windows registry entry. So this is a security
permission problem. I suggest you try the following steps first:

1. Change your ASP.NET application's process idenitity to LOCAL SYSTEM and
run it to see whether the problem still occurs. If still occurs, that
means
this is not a raw windows security issue, but a .NET code access security
issue. If the problem go away, we need to check the original process
identity's windows permission to the registry.

2. If we've confirmed that this is a .NET CAS issue through #1, we need to
check our asp.net application's Trust Level first, is your ASP.NET
application running under "Full" trustlevel? The trust level can be
configured in the web.config(or machine.config) through the <trust>
element:

#trust Element (ASP.NET Settings Schema)
http://msdn2.microsoft.com/en-us/lib...93(VS.80).aspx

If the original value is not set as "Full" , you can manually set the
application's Trust level to "Full", like below:

<trust
level="Full"
/>
After that, test the application again to see whether it can run
correctly(access the registry correctly).

Hope this helps.

Regards,

Steven Cheng
Microsoft Online Community Support
==================================================

When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.

==================================================
This posting is provided "AS IS" with no warranties, and confers no
rights.

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)


Apr 6 '06 #4
Ankit Aneja wrote:
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.Instr umentation.PerformanceCounte
rInstances.ReportCounterFailure(String message)
Microsoft.Practices.EnterpriseLibrary.Common.Instr umentation.PerformanceCounte
rInstances..ctor(String categoryName, String counterName, Boolean
createNewInstance)
Microsoft.Practices.EnterpriseLibrary.Common.Instr umentation.InstrumentedEvent
.AddPerformanceCounter(String category, String[] counterNames, Boolean
createNewInstance)
Microsoft.Practices.EnterpriseLibrary.Common.Instr umentation.InstrumentedEvent
.Initialize(String counterCategory, String[] counterNames, Boolean
createNewInstance, String eventLogSource, EventLogIdentifier[] eventIds)
Microsoft.Practices.EnterpriseLibrary.Common.Instr umentation.InstrumentedEvent
..ctor(String counterCategory, String[] counterNames, Boolean
createNewInstance)
Microsoft.Practices.EnterpriseLibrary.Data.Instrum entation.DataServiceEvent..c
tor(String[] counterNames)
Microsoft.Practices.EnterpriseLibrary.Data.Instrum entation.DataCommandFailedEv
ent..ctor(String[] counterNames)
Microsoft.Practices.EnterpriseLibrary.Data.Instrum entation.DataCommandFailedEv
ent..cctor()

hey Ankit,
this is the problem of registry settings in Enterprise Library.
Just run the batch file of "Install Services" provided in the Enterprise
Library. I hope it may solve ur problem.
Regards,
Sandeep
Apr 6 '06 #5
Thanks for your response Ankit,

What's your webserver's OS version and is it using IIS5 or IIS6? As for
the step1 I mentioned before, it depend on the IIS server your application
running against. For IIS 5, it use the ASP.NET processModel, you can change
ASP.NET process idenitity through the <processModel> element in the
machine.config file. For IIS6, it by default use applicationPool model, so
you can just configure your ASP.NET application(virutal dir)'s application
pool's idenitity account. Change the account to LocalSystem and test it to
see whether it works

for IIS5
#<processModel> Element
http://msdn.microsoft.com/library/en...cessmodelsecti
on.asp?frame=true
for IIS6
#Identity Application Pool Settings
http://msdn.microsoft.com/library/en...tityapplicatio
npoolsettings.asp?frame=true

if change process idenitity to run under LOCALSYSTEM not work, you should
check the .NET CAS setting as I mentioned in step2:

#ASP.NET Trust Levels and Policy Files
http://msdn.microsoft.com/library/en...ettrustlevelsp
olicyfiles.asp?frame=true
Regards,

Steven Cheng
Microsoft Online Community Support
==================================================

When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.

==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)

Apr 6 '06 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Donald Hurley | last post by:
When running my application on accounts that don't have admin privileges, I recieve the following error (I am trying to write to the Application event log): System.Security.SecurityException:...
3
by: Professor Frink | last post by:
First off, I apologize if this gets long. I'm simply trying to give you all enough information to help me out. I'm writing (almost finished, actually), my first VB.Net application. It's a forms...
1
by: .YC | last post by:
Hi, I was trying on the following code n I got an exception. Can anyone tell me whats wrong? using System; namespace Module_2 { /// <summary>
5
by: PCC | last post by:
I am using the Exception Managment Application Block on Windows Server 2003 Enterprise and .NET v1.1. If I use the block with an ASP.NET web wervice or in a web application I get the following...
2
by: Ray5531 | last post by:
I keep getting this error when my asp.net application tries to write into the registry System.Security.SecurityException: Requested registry access is not allowed. I followed the following...
7
by: Chuck Hartman | last post by:
I have a Windows service that requests web pages from a site using an HttpWebRequest object. When I try to request a page from an ASP.NET 2 site, I get a WebException with message "The remote...
3
by: Ankit Aneja | last post by:
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 ...
3
by: Mike | last post by:
Hi I have problem as folow: Caught Exception: System.Configuration.ConfigurationErrorsException: An error occurred loading a configuration file: Request for the permission of type...
2
ssnaik84
by: ssnaik84 | last post by:
Hello, I have hosted a website on GoDaddy.com. It's a share hosting. I am using XML file as a database. That means, I am reading and writing data into XML file instead of regular RDBMS (MySQL, MS...
0
by: jianzs | last post by:
Introduction Cloud-native applications are conventionally identified as those designed and nurtured on cloud infrastructure. Such applications, rooted in cloud technologies, skillfully benefit from...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 7 Feb 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:30 (7.30PM). In this month's session, the creator of the excellent VBE...
0
by: fareedcanada | last post by:
Hello I am trying to split number on their count. suppose i have 121314151617 (12cnt) then number should be split like 12,13,14,15,16,17 and if 11314151617 (11cnt) then should be split like...
0
Git
by: egorbl4 | last post by:
Скачал я git, хотел начать настройку, а там вылезло вот это Что это? Что мне с этим делать? ...
0
by: MeoLessi9 | last post by:
I have VirtualBox installed on Windows 11 and now I would like to install Kali on a virtual machine. However, on the official website, I see two options: "Installer images" and "Virtual machines"....
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: Aftab Ahmad | last post by:
Hello Experts! I have written a code in MS Access for a cmd called "WhatsApp Message" to open WhatsApp using that very code but the problem is that it gives a popup message everytime I clicked on...
0
by: Aftab Ahmad | last post by:
So, I have written a code for a cmd called "Send WhatsApp Message" to open and send WhatsApp messaage. The code is given below. Dim IE As Object Set IE =...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.