Wrox Home  
Search P2P Archive for: Go

  Return to Index  

aspx_professional thread: Access to the registry key denied


Message #1 by "andrew hazell" <andrew.hazell@a...> on Thu, 19 Sep 2002 14:11:11
Thank you Kevin for the advice.  However I tried it and it still comes up 
with the same error message.

I originally created a Data Access Layer as a class which worked fine.  
When I put the code into a control and tried to use transaction support 
with COM+ that's when I got the problems with security.  I have been 
trying to resolve this problem for about 3 weeks now so I think it's time 
to revert back to the original way.

If you have any other ideas I would be very grateful.

Thanks,

Andy
> 
The registry itself has special access permissions. You need to grant the
ASPNET account access to that registry
key on your machine. To do this, you:

Use Regedt32
Navigate to the key that is giving you trouble (the key I had trouble with
was HKEY_LOCAL_MACHINE\Software\Microsoft\WindowsNT\CurrentVersion\PerfLib
, but yours is apparently HKEY_CLASSES_ROOT\FPD.Data.ctrlSQLDAL).

Navigate to the Security menu. Click Permissions.
Click Add.
Select the LOCAL MACHINE account under which ASP.NET is running (default is
ASPNET).
Click Add.

That should give you access to the appropriate registry key.




"andrew hazell" <andrew.hazell@a...> on 09/19/2002 09:11:11 AM

Please respond to "ASPX_Professional" <aspx_professional@p...>

To:   "ASPX_Professional" <aspx_professional@p...>
cc:

Subject:  [aspx_professional] Access to the registry key denied

I have recently downloaded a Data Access Component from Wrox which is
featured in Chapter 11 of 'Professional VB.NET 2nd Edition'.  When I try
to use it in my pages I get the following error:
"
Access to the registry key HKEY_CLASSES_ROOT\FPD.Data.ctrlSQLDAL is
denied.
Description: An unhandled exception occurred during the execution of the
current web request. Please review the stack trace for more information
about the error and where it originated in the code.

Exception Details: System.UnauthorizedAccessException: Access to the
registry key HKEY_CLASSES_ROOT\FPD.Data.ctrlSQLDAL is denied.

The ASP.NET process is not authorized to access the requested resource.
For security reasons the default ASP.NET process identity is '{machinename}
\ASPNET', which has limited privileges. Consider granting access rights to
the resource to the ASP.NET process identity.

To grant ASP.NET write access to a file, right-click the file in Explorer,
choose "Properties" and select the Security tab. Click "Add" to add
the "{machinename}\ASPNET" user. Highlight the ASP.NET account, and check
the Write box in the Allow column.

Source Error:

Line 44:
Line 45:         'Try
Line 46:         objDAL = New ctrlSQLDAL()
Line 47:         objDAL.DBConnection = strConnection
Line 48:
Source File: C:\Inetpub\wwwroot\fpd\cms\cma\ContentList.ascx.vb    Line:
46
"

I have used the sn tool to generate an .snk file and also registered
FPD.Data.dll with regsvcs.  Both gave success messages.  I have tried
changing the permissions for the APSNET user but I don't really know what
I'm doing when it comes to Windows security.

I am running windows 2000 pro if that matters.  I have been pulling my
hair out now for about two weeks over this one.

Can anyone out there help please.

Thanks,

Andy
---

ASP.NET 1.0 Namespace Reference with C#
http://www.wrox.com/acon11.asp?ISBN=1861007442

ASP.NET 1.0 Namespace Reference with VB.NET
http://www.wrox.com/acon11.asp?ISBN=1861007450

These books are a complete reference to the ASP.NET namespaces
for developers who are already familiar with using ASP.NET.
There is no trivial introductory material or useless .NET
hype and the presentation of the namespaces, in an easy-to use
alphabetical order ensures a user-friendly reference format.
We provide in-depth coverage of all the major ASP.NET classes,
giving you those real-world tips that the documentation doesn't
offer, and demonstrating complex techniques with simple
examples.

---
---
Change your mail options at http://p2p.wrox.com/manager.asp or
to unsubscribe send a blank email to









  Return to Index