r3r
asked on
ASP.NET, ADO.NET System.Security.SecurityException: Requested registry access is not allowed
Hi,
I'm having the typical problem of running an ASP.NET / ADO.NET app on my home machine and getting the error:
System.Security.SecurityEx ception: Requested registry access is not allowed
I've read a lot of solutions for this, but none are working for me. I'm even getting the error if I recreate the application from scratch. Basically, I can't access an access database from ASP (all other non-database apps work fine, so ASP.NET is installed correctly)
I originally created the application on a lab machine at school (Win XP Pro, non-admin account) and am trying to modify it on my home rig (Win 2000, Administrator account).
Here's what I've tried so far:
from administrative tools- tried using Microsoft .NET Framework 1.1 Configuration
-tried Microsoft .NET Framework 1.1 Wizards
-adjusted .net security to full trust for local and MyComputer
-trust the assembly in question (in this case assembly name is DataGridII.dll
- tried "fix the application wizard", but the DataGridII is not listed.
after that I changed the permission for IUSR_myMachine, IWAM_myMachine, and ASPNET all to have admistrator priveleges-still no luck.
Next, I went into the machine.config file and changed "machine" to "system" under process model tag, but that didn't work.
And of course, I've rebooted, restarted IIS many, many times in between.
What is the deal with this? I know this exception is from not having permission to access the registry, but I would think after all these changes I should have no problem whatsover.
Any help is greatly appreciated. I've also scoured this site and combed through the first 50 searches on Google/ Yahoo. If you find a fix I missed send it on...
Oh yea, I also changed the registry to allow event logging, though that wasn't my specific concern. Somehow this is a related issue.
500 points to the first genious who solves this one..
:-)
r3r
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.SecurityEx ception: Requested registry access is not allowed.
Source Error:
Line 16: 'conConnection
Line 17: '
Line 18: Me.conConnection.Connectio nString = "Jet OLEDB:Registry Path=;Data Source=""D:\Inetpub\wwwroo t\myWEB\Da taGrid\bin \Cours" & _
Line 19: "e.mdb"";Jet OLEDB:System database=;Jet OLEDB:Global Bulk Transactions=1;User ID=A" & _
Line 20: "dmin;Provider=""Microsoft .Jet.OLEDB .4.0"";Jet OLEDB:Don't Copy Locale on Compact=F" & _
Source File: d:\inetpub\wwwroot\myWEB\D ataGridII\ StudentDat a.aspx.vb Line: 18
Stack Trace:
[SecurityException: Requested registry access is not allowed.]
Microsoft.Win32.RegistryKe y.OpenSubK ey(String name, Boolean writable) +473
System.Data.Common.ADP.Cla ssesRootRe gistryValu e(String subkey, String queryvalue)
System.Data.OleDb.OleDbCon nectionStr ing.Valida teParse()
System.Data.Common.DBConne ctionStrin g..ctor(St ring connectionString, UdlSupport checkForUdl)
System.Data.OleDb.OleDbCon nectionStr ing..ctor( String connectionString)
System.Data.OleDb.OleDbCon nectionStr ing.ParseS tring(Stri ng connectionString)
System.Data.OleDb.OleDbCon nection.se t_Connecti onString(S tring value)
DataGridII.WebForm1.Initia lizeCompon ent() in d:\inetpub\wwwroot\myWEB\D ataGridII\ StudentDat a.aspx.vb: 18
DataGridII.WebForm1.Page_I nit(Object sender, EventArgs e) in d:\inetpub\wwwroot\myWEB\D ataGridII\ StudentDat a.aspx.vb: 40
System.Web.UI.Control.OnIn it(EventAr gs e)
System.Web.UI.Control.Init Recursive( Control namingContainer)
System.Web.UI.Page.Process RequestMai n()
System.Web.UI.Page.Process Request()
System.Web.UI.Page.Process Request(Ht tpContext context)
System.Web.CallHandlerExec utionStep. System.Web .HttpAppli cation+IEx ecutionSte p.Execute( )
System.Web.HttpApplication .ExecuteSt ep(IExecut ionStep step, Boolean& completedSynchronously) +87
-------------------------- ---------- ---------- ---------- ---------- ---------- ----
Version Information: Microsoft .NET Framework Version:1.1.4322.2032; ASP.NET Version:1.1.4322.2032
I'm having the typical problem of running an ASP.NET / ADO.NET app on my home machine and getting the error:
System.Security.SecurityEx
I've read a lot of solutions for this, but none are working for me. I'm even getting the error if I recreate the application from scratch. Basically, I can't access an access database from ASP (all other non-database apps work fine, so ASP.NET is installed correctly)
I originally created the application on a lab machine at school (Win XP Pro, non-admin account) and am trying to modify it on my home rig (Win 2000, Administrator account).
Here's what I've tried so far:
from administrative tools- tried using Microsoft .NET Framework 1.1 Configuration
-tried Microsoft .NET Framework 1.1 Wizards
-adjusted .net security to full trust for local and MyComputer
-trust the assembly in question (in this case assembly name is DataGridII.dll
- tried "fix the application wizard", but the DataGridII is not listed.
after that I changed the permission for IUSR_myMachine, IWAM_myMachine, and ASPNET all to have admistrator priveleges-still no luck.
Next, I went into the machine.config file and changed "machine" to "system" under process model tag, but that didn't work.
And of course, I've rebooted, restarted IIS many, many times in between.
What is the deal with this? I know this exception is from not having permission to access the registry, but I would think after all these changes I should have no problem whatsover.
Any help is greatly appreciated. I've also scoured this site and combed through the first 50 searches on Google/ Yahoo. If you find a fix I missed send it on...
Oh yea, I also changed the registry to allow event logging, though that wasn't my specific concern. Somehow this is a related issue.
500 points to the first genious who solves this one..
:-)
r3r
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.SecurityEx
Source Error:
Line 16: 'conConnection
Line 17: '
Line 18: Me.conConnection.Connectio
Line 19: "e.mdb"";Jet OLEDB:System database=;Jet OLEDB:Global Bulk Transactions=1;User ID=A" & _
Line 20: "dmin;Provider=""Microsoft
Source File: d:\inetpub\wwwroot\myWEB\D
Stack Trace:
[SecurityException: Requested registry access is not allowed.]
Microsoft.Win32.RegistryKe
System.Data.Common.ADP.Cla
System.Data.OleDb.OleDbCon
System.Data.Common.DBConne
System.Data.OleDb.OleDbCon
System.Data.OleDb.OleDbCon
System.Data.OleDb.OleDbCon
DataGridII.WebForm1.Initia
DataGridII.WebForm1.Page_I
System.Web.UI.Control.OnIn
System.Web.UI.Control.Init
System.Web.UI.Page.Process
System.Web.UI.Page.Process
System.Web.UI.Page.Process
System.Web.CallHandlerExec
System.Web.HttpApplication
--------------------------
Version Information: Microsoft .NET Framework Version:1.1.4322.2032; ASP.NET Version:1.1.4322.2032
ASKER
Good thought, but no luck here,either. Still getting same type message w/ new connection string.
Source Error:
Line 16: 'conConnection
Line 17: '
Line 18: Me.conConnection.Connectio nString = "Provider=Microsoft.Jet.OL EDB.4.0;Da ta Source=D:\Inetpub\wwwroot\ myWEB\Data Grid\bi" & _
Line 19: "n\Course.mdb;User Id=admin;Password=;"
Line 20:
Source File: d:\inetpub\wwwroot\myWEB\D ataGridII\ StudentDat a.aspx.vb Line: 18
Stack Trace:
[SecurityException: Requested registry access is not allowed.]
Microsoft.Win32.RegistryKe y.OpenSubK ey(String name, Boolean writable) +473
System.Data.Common.ADP.Cla ssesRootRe gistryValu e(String subkey, String queryvalue)
System.Data.OleDb.OleDbCon nectionStr ing.Valida teParse()
System.Data.Common.DBConne ctionStrin g..ctor(St ring connectionString, UdlSupport checkForUdl)
System.Data.OleDb.OleDbCon nectionStr ing..ctor( String connectionString)
System.Data.OleDb.OleDbCon nectionStr ing.ParseS tring(Stri ng connectionString)
System.Data.OleDb.OleDbCon nection.se t_Connecti onString(S tring value)
DataGridII.WebForm1.Initia lizeCompon ent() in d:\inetpub\wwwroot\myWEB\D ataGridII\ StudentDat a.aspx.vb: 18
DataGridII.WebForm1.Page_I nit(Object sender, EventArgs e) in d:\inetpub\wwwroot\myWEB\D ataGridII\ StudentDat a.aspx.vb: 35
System.Web.UI.Control.OnIn it(EventAr gs e)
System.Web.UI.Control.Init Recursive( Control namingContainer)
System.Web.UI.Page.Process RequestMai n()
System.Web.UI.Page.Process Request()
System.Web.UI.Page.Process Request(Ht tpContext context)
System.Web.CallHandlerExec utionStep. System.Web .HttpAppli cation+IEx ecutionSte p.Execute( )
System.Web.HttpApplication .ExecuteSt ep(IExecut ionStep step, Boolean& completedSynchronously) +87
-------------------------- ---------- ---------- ---------- ---------- ---------- ----
Version Information: Microsoft .NET Framework Version:1.1.4322.2032; ASP.NET Version:1.1.4322.2032
Source Error:
Line 16: 'conConnection
Line 17: '
Line 18: Me.conConnection.Connectio
Line 19: "n\Course.mdb;User Id=admin;Password=;"
Line 20:
Source File: d:\inetpub\wwwroot\myWEB\D
Stack Trace:
[SecurityException: Requested registry access is not allowed.]
Microsoft.Win32.RegistryKe
System.Data.Common.ADP.Cla
System.Data.OleDb.OleDbCon
System.Data.Common.DBConne
System.Data.OleDb.OleDbCon
System.Data.OleDb.OleDbCon
System.Data.OleDb.OleDbCon
DataGridII.WebForm1.Initia
DataGridII.WebForm1.Page_I
System.Web.UI.Control.OnIn
System.Web.UI.Control.Init
System.Web.UI.Page.Process
System.Web.UI.Page.Process
System.Web.UI.Page.Process
System.Web.CallHandlerExec
System.Web.HttpApplication
--------------------------
Version Information: Microsoft .NET Framework Version:1.1.4322.2032; ASP.NET Version:1.1.4322.2032
ASKER
I resolved the issue. I had to re-map the virtual directories in wwwroot folder for the new security settings to take place. Thanks anyway.
r3r
r3r
Please post a request to delete this question and refund points.
https://www.experts-exchange.com/Community_Support/
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
"Provider=Microsoft.Jet.OL