473,320 Members | 1,868 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,320 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 9736
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: 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: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

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.