CodeCharge Studio
search Register Login  

Web Reporting

Visually create Web Reports in PHP, ASP, .NET, Java, Perl and ColdFusion.
CodeCharge.com

YesSoftware Forums -> CodeCharge -> Tips & Solutions

 SOLUTION FOR DOTNET ERROR: System.Security.SecurityException: Requested registry access is not allowed.

Print topic Send  topic

Author Message
navcan

Posts: 61
Posted: 11/22/2005, 5:29 PM

IF YOU ARE DEVELOPING A PROJECT IN CCS 3.0 (IN DOTNET 1.1 OR 2.0 ENVIRONMENT) AND EVER COME WITH A PROBLEM/ERROR (MENTIONED BELOW) WHILE RUNNING THE LIVE PAGE ON THE BROWSER, PLEASE FOLLOW THE SOLUTION WHICH IS AT THE BOTTOM OF THE POST.

MY DEVELOPMENT ENVIRONMENT IS

WINDOWS XP SP2 MEDIA CENTER PC (DUAL CORE PROCESSOR)
SQL 2000
CCS 3.0
ASP.NET APPLICATION

I WAS GETTING THE FOLLOWING ERROR WHILE RUNNING THE LIVE PAGE ON THE BROWSER.

Server Error in '/applicationname' 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:

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.Data.Common.ADP.ClassesRootRegistryValue(String subkey, String queryvalue) +219
System.Data.OleDb.OleDbConnectionString.ValidateParse() +371
System.Data.Common.DBConnectionString..ctor(String connectionString, UdlSupport checkForUdl) +144
System.Data.OleDb.OleDbConnectionString.ParseString(String connectionString) +98
System.Data.OleDb.OleDbConnection.set_ConnectionString(String value) +11
System.Data.OleDb.OleDbConnection..ctor(String connectionString) +159
applicationname.Data.OleDbDao..ctor(ConnectionString connection) +195
applicationname.Configuration.Settings.get_dbconnectionNAMEDataAccessObject() +46
applicationname.pagename.tblNamesDataProvider..ctor() +447
applicationname.pagename.pagenamePage.OnInit(EventArgs e) +397
System.Web.UI.Control.InitRecursive(Control namingContainer) +240
System.Web.UI.Page.ProcessRequestMain() +2112
System.Web.UI.Page.ProcessRequest() +218
System.Web.UI.Page.ProcessRequest(HttpContext context) +18
System.Web.CallHandlerExecutionStep.System.Web.HttpApplication+IExecutionStep.Execute() +179
System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +87


--------------------------------------------------------------------------------
Version Information: Microsoft .NET Framework Version:1.1.4322.2032; ASP.NET Version:1.1.4322.2032

I TRIED EVERYTHING, CHANGED THE PERMISSIONS ON REGISTRY SETTINGS, UNINSTALLED DOTNET FRAMEWORK, REINSTALLED DOTNET FRAMEWORK, TRIED MS KB ARTICLE 329291, RESEARCHED ON THE TECHNET, MSDN, GOOGLE, GAVE ADMINISTRATOR PERMISSIONS TO ASPNET ACCOUNT ETC ETC -- NO LUCK!!!

WELL FINALLY BEFORE TURNING THE COMPUTER OFF, I GAVE A LAST TRY AND BINGO!!! IT WORKED!!!

SOLUTION IS AS FOLLOW (THIS SOLUTION IS FOR DEVELOPMENT ENVIRONMENT ONLY):

1. Give the ASPNET user permission to read the Security eventlog registry entry.

Run regedt32
Navigate to the following key:
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Eventlog\Security
Right click on this entry and select Permissions
Add the ASPNET user
Give it Read permission

2. Change settings in machine.config file

Run Explorer
Navigate to WINDOWS or WINNT folder
Open Microsoft.NET folder
Open Framework folder
Open v1.1.4322 folder (folder name may be different, depending on what dotnet version is installed)
Open CONFIG folder
Open machine.config file using notepad (make a backup of this file first)
Locate processmodel tag (approx. at line 441)
Locate userName="machine" (approx. at line 452)
Change it to userName="SYSTEM"
Save and close the file
Close Explorer

3. Restart IIS

Run IISReset

THAT'S IT. HAPPY PROGRAMMING...O:)




View profile  Send private message
navcan

Posts: 61
Posted: 11/23/2005, 2:17 PM

SORRY THIS POST WAS SUPPOSE TO BE UNDER CODECHARGE STUDIO. :-)
View profile  Send private message
Harsh
Posted: 12/19/2005, 4:07 AM

:-X

Hi i coudl not find

"Locate userName="machine" (approx. at line 452)
Change it to userName="SYSTEM""

in your step 2

please mail me for the same.
Cam
Posted: 01/18/2006, 9:07 PM

:-D
Dude That was fantastic.... It worked like a charm.... Thanks a billion
hema
Posted: 01/25/2006, 7:42 AM

That worked
AndreG
Posted: 01/31/2006, 11:35 AM

Just an addendum to this note. This worked for me (thanks so much for the solution), but only after I rebooted my laptop. Recycling IIS was not enough.
Sabah Tahir
Posted: 03/10/2006, 2:39 AM

:-)

a very good solution indeed and it works like magic. u saved us from doing all the installations and uninstallations due to error.


Take care
Sabah
supriya
Posted: 03/22/2006, 10:28 PM

Hey... this worked for me too.

Just wondering whether it is safe to implement this on the production server. Noticed you mention that this solution is only for development environment. What if this error occurs on the production environment as well?
Mohit Datta
Posted: 03/28/2006, 6:51 AM

Everything was working fine and dandy.

I installed SQL Client and Visual Basic.

Started getting the error above (using oledb. SQLClient libraries worked just fine).

Tried the fixes above. No luck.

I uninstalled the software listed above. Still no luck.

Now, I tried the fixes above. WOrks fine.

It would be great if someone could explain exactly what is going on.
If installing sql server client or vb 6.0 breaks this, I'll be mad.
Seko
Posted: 04/21/2006, 6:25 AM

Tanks a million...After all the searching and cursing...your solution works like magic...
Janak Makwana
Posted: 05/17/2006, 2:22 AM

That's great

I tried to solve this problem from last 25 hrs continuously.

Finally i got ur idea and problem is solved and which tends to me for happly sleep now....:-)

Chris Darts
Posted: 05/22/2006, 5:25 AM

This worked perfectly first time. I have spent ages trying different permissions settings within RegEdit and nothing worked. I guess it must be the combination of the permissions and the userName setting in the machine.config file.

Without wishing to overstate the importance of this solution, it saved my life!

Thank you.
Fasil
Posted: 05/26/2006, 6:19 AM

:-) thanks alot, it saved me time.

Regards,

From Ethiopia
yamini

Posts: 1
Posted: 06/15/2006, 11:01 AM

Thanks for the solution. It works great.
Do I have to do the same in development and production server???????????

Thanks,
View profile  Send private message
PhaniKumar

Posts: 2
Posted: 07/13/2006, 12:14 AM

Its Really Good...

_________________
U.PhaniKumar MCP,
View profile  Send private message
fahimanwar

Posts: 1
Posted: 09/24/2006, 11:20 AM

hi guys , me have the same problem of registry writing , but its not on win2000 its on windows xp server machiene
is there any other thing to do for this window..


please help me cause its a server machiene and should be started asap

thnx fahim
View profile  Send private message
gail

Posts: 1
Posted: 11/28/2006, 4:11 PM

:-)
Thank you, thank you, thank you! I've just spent 2 days trying to sort this one out, trying all the same things you did until I just stumbled across your solution - and it works!!! (I didn't need to reboot - just restarted IIS as you suggested).

Can't thank you enough - of all the MANY proposed solutions I have seen (and tried) none have come close to yours.

Whew! now I can move forward... thanks heaps!


Quote navcan:
IF YOU ARE DEVELOPING A PROJECT IN CCS 3.0 (IN DOTNET 1.1 OR 2.0 ENVIRONMENT) AND EVER COME WITH A PROBLEM/ERROR (MENTIONED BELOW) WHILE RUNNING THE LIVE PAGE ON THE BROWSER, PLEASE FOLLOW THE SOLUTION WHICH IS AT THE BOTTOM OF THE POST.

MY DEVELOPMENT ENVIRONMENT IS

WINDOWS XP SP2 MEDIA CENTER PC (DUAL CORE PROCESSOR)
SQL 2000
CCS 3.0
ASP.NET APPLICATION

I WAS GETTING THE FOLLOWING ERROR WHILE RUNNING THE LIVE PAGE ON THE BROWSER.

Server Error in '/applicationname' 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:

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.Data.Common.ADP.ClassesRootRegistryValue(String subkey, String queryvalue) +219
System.Data.OleDb.OleDbConnectionString.ValidateParse() +371
System.Data.Common.DBConnectionString..ctor(String connectionString, UdlSupport checkForUdl) +144
System.Data.OleDb.OleDbConnectionString.ParseString(String connectionString) +98
System.Data.OleDb.OleDbConnection.set_ConnectionString(String value) +11
System.Data.OleDb.OleDbConnection..ctor(String connectionString) +159
applicationname.Data.OleDbDao..ctor(ConnectionString connection) +195
applicationname.Configuration.Settings.get_dbconnectionNAMEDataAccessObject() +46
applicationname.pagename.tblNamesDataProvider..ctor() +447
applicationname.pagename.pagenamePage.OnInit(EventArgs e) +397
System.Web.UI.Control.InitRecursive(Control namingContainer) +240
System.Web.UI.Page.ProcessRequestMain() +2112
System.Web.UI.Page.ProcessRequest() +218
System.Web.UI.Page.ProcessRequest(HttpContext context) +18
System.Web.CallHandlerExecutionStep.System.Web.HttpApplication+IExecutionStep.Execute() +179
System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +87


--------------------------------------------------------------------------------
Version Information: Microsoft .NET Framework Version:1.1.4322.2032; ASP.NET Version:1.1.4322.2032

I TRIED EVERYTHING, CHANGED THE PERMISSIONS ON REGISTRY SETTINGS, UNINSTALLED DOTNET FRAMEWORK, REINSTALLED DOTNET FRAMEWORK, TRIED MS KB ARTICLE 329291, RESEARCHED ON THE TECHNET, MSDN, GOOGLE, GAVE ADMINISTRATOR PERMISSIONS TO ASPNET ACCOUNT ETC ETC -- NO LUCK!!!

WELL FINALLY BEFORE TURNING THE COMPUTER OFF, I GAVE A LAST TRY AND BINGO!!! IT WORKED!!!

SOLUTION IS AS FOLLOW (THIS SOLUTION IS FOR DEVELOPMENT ENVIRONMENT ONLY):

1. Give the ASPNET user permission to read the Security eventlog registry entry.

Run regedt32
Navigate to the following key:
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Eventlog\Security
Right click on this entry and select Permissions
Add the ASPNET user
Give it Read permission

2. Change settings in machine.config file

Run Explorer
Navigate to WINDOWS or WINNT folder
Open Microsoft.NET folder
Open Framework folder
Open v1.1.4322 folder (folder name may be different, depending on what dotnet version is installed)
Open CONFIG folder
Open machine.config file using notepad (make a backup of this file first)
Locate processmodel tag (approx. at line 441)
Locate userName="machine" (approx. at line 452)
Change it to userName="SYSTEM"
Save and close the file
Close Explorer

3. Restart IIS

Run IISReset

THAT'S IT. HAPPY PROGRAMMING...O:)





:-)
View profile  Send private message

Add new topic Subscribe to topic   


These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit http://support.yessoftware.com.

PHP Reports

Visually create Web Reports in PHP, ASP, .NET, Java, Perl and ColdFusion.
CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


Powered by UltraApps Forum created with CodeCharge Studio
Copyright © 2003-2004 by UltraApps.com  and YesSoftware, Inc.