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.SecurityException: 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.SecurityException: Requested registry access is not allowed.

Source Error:


Line 16:         'conConnection
Line 17:         '
Line 18:         Me.conConnection.ConnectionString = "Jet OLEDB:Registry Path=;Data Source=""D:\Inetpub\wwwroot\myWEB\DataGrid\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\DataGridII\StudentData.aspx.vb    Line: 18

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)
   System.Data.OleDb.OleDbConnectionString.ValidateParse()
   System.Data.Common.DBConnectionString..ctor(String connectionString, UdlSupport checkForUdl)
   System.Data.OleDb.OleDbConnectionString..ctor(String connectionString)
   System.Data.OleDb.OleDbConnectionString.ParseString(String connectionString)
   System.Data.OleDb.OleDbConnection.set_ConnectionString(String value)
   DataGridII.WebForm1.InitializeComponent() in d:\inetpub\wwwroot\myWEB\DataGridII\StudentData.aspx.vb:18
   DataGridII.WebForm1.Page_Init(Object sender, EventArgs e) in d:\inetpub\wwwroot\myWEB\DataGridII\StudentData.aspx.vb:40
   System.Web.UI.Control.OnInit(EventArgs e)
   System.Web.UI.Control.InitRecursive(Control namingContainer)
   System.Web.UI.Page.ProcessRequestMain()
   System.Web.UI.Page.ProcessRequest()
   System.Web.UI.Page.ProcessRequest(HttpContext context)
   System.Web.CallHandlerExecutionStep.System.Web.HttpApplication+IExecutionStep.Execute()
   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
r3rAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

ihenryCommented:
Use simpler connection string.

"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=D:\Inetpub\wwwroot\myWEB\DataGrid\bin\Course.mdb;User Id=admin;Password=;"
0
r3rAuthor Commented:
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.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=D:\Inetpub\wwwroot\myWEB\DataGrid\bi" & _
Line 19:         "n\Course.mdb;User Id=admin;Password=;"
Line 20:
 

Source File: d:\inetpub\wwwroot\myWEB\DataGridII\StudentData.aspx.vb    Line: 18

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)
   System.Data.OleDb.OleDbConnectionString.ValidateParse()
   System.Data.Common.DBConnectionString..ctor(String connectionString, UdlSupport checkForUdl)
   System.Data.OleDb.OleDbConnectionString..ctor(String connectionString)
   System.Data.OleDb.OleDbConnectionString.ParseString(String connectionString)
   System.Data.OleDb.OleDbConnection.set_ConnectionString(String value)
   DataGridII.WebForm1.InitializeComponent() in d:\inetpub\wwwroot\myWEB\DataGridII\StudentData.aspx.vb:18
   DataGridII.WebForm1.Page_Init(Object sender, EventArgs e) in d:\inetpub\wwwroot\myWEB\DataGridII\StudentData.aspx.vb:35
   System.Web.UI.Control.OnInit(EventArgs e)
   System.Web.UI.Control.InitRecursive(Control namingContainer)
   System.Web.UI.Page.ProcessRequestMain()
   System.Web.UI.Page.ProcessRequest()
   System.Web.UI.Page.ProcessRequest(HttpContext context)
   System.Web.CallHandlerExecutionStep.System.Web.HttpApplication+IExecutionStep.Execute()
   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
0
r3rAuthor Commented:
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
0
ihenryCommented:

Please post a request to delete this question and refund points.
http://www.experts-exchange.com/Community_Support/
0
ee_ai_constructCommented:
Question answered by asker or dialog valuable.
Closed, 500 points refunded.
ee_ai_construct (replacement part #xm34)
Community Support Admin
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
ASP.NET

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.