Access Is Denied

From: will eichert (wfeichert_at_ucdavis.edu)
Date: 09/30/03


Date: Mon, 29 Sep 2003 15:15:13 -0700


New to .NET, and trying to get a web application using one of my older
COM components to work.

It works from VB.NET or VB.C# desktop app, but when instantiating an
object from my COM component in an ASP.NET app, I get the Access
Denied error.

I have disabled the Indexing service, and granted full privileges to
the {MACHINE}\ASPNET account for this file, and it still doesn't work.

I wasn't certain which files need privileges for the {MACHINE}\ASPNET
account, so I granted the privileges from the files mycomponent.exe
(this is the actual COM component), and all of the files in the BIN
directory of my app (interop.mycomponent.dll, interop.vba.dll,
mycomponent.dll, mycomponent.pdb).

I am not impersonating, and would like to save myself the trouble of
impersonating, unless it's really necessary.

Can anyone tell me why I'm getting this message, and how to resolve
the problem?

The full text of the message is below.

Thanks,

Will Eichert

Server Error in '/sensors' Application.
--------------------------------------------------------------------------------

Access 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 is
denied.

ASP.NET is not authorized to access the requested resource. Consider
granting access rights to the resource to the ASP.NET request
identity. ASP.NET has a base process identity (typically
{MACHINE}\ASPNET on IIS 5 or Network Service on IIS 6) that is used if
the application is not impersonating. If the application is
impersonating via <identity impersonate="true"/>, the identity will be
the anonymous user (typically IUSR_MACHINENAME) or the authenticated
request user.

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 appropriate user or group. Highlight the ASP.NET account,
and check the boxes for the desired access.

Source Error:

Line 28: Dim i As Int16, tstr As String
Line 29: 'gInitializer =
Server.CreateObject("SensorServices.SensorInitializer")
Line 30: gInitializer = New SensorServices.SensorInitializer
Line 31: tags = gInitializer.tags
Line 32: For i = 1 To tags.tagcount
 

Source File: c:\inetpub\wwwroot\sensors\WebForm1.aspx.vb Line: 30

Stack Trace:

[UnauthorizedAccessException: Access is denied.]
   sensors.WebForm1.Page_Load(Object sender, EventArgs e) in
c:\inetpub\wwwroot\sensors\WebForm1.aspx.vb:30
   System.Web.UI.Control.OnLoad(EventArgs e)
   System.Web.UI.Control.LoadRecursive()
   System.Web.UI.Page.ProcessRequestMain()

 

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



Relevant Pages

  • Re: Word 2003 and DotNet
    ... You could give enough priveleges to asp.net account though I don't recommend ... reports in word programmatically directly in a Word document. ... If the application is impersonating via <identity ... IUSR_MACHINENAME) or the authenticated request user. ...
    (microsoft.public.dotnet.general)
  • Re: Debugging a c# serviced component
    ... The error message gives you excellent advice. ... want your ASP.NET app to call the registry, you have to provide an account ... > granting access rights to the resource to the ASP.NET request identity. ... Highlight the ASP.NET account, and check the ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: Performance monitoring: strange error in .Net 2.0
    ... | Logon OK ... impersonated another account with administrator rights (neither of the two ... > Note also that your code is impersonating an interactive logon type, ... The real app uses either interactive or LOGON32_LOGON_NEW_CREDENTIALS, ...
    (microsoft.public.dotnet.framework.clr)
  • Where is the built-in ASP.NET account?
    ... granting access rights to the resource to the ASP.NET request identity. ... If the application is impersonating via <identity ... I then found the following to try to recreate the ASP.NET account using the ...
    (microsoft.public.dotnet.framework.aspnet)
  • ADODB.NET and "Access Denied"
    ... I have an ASP.NET page writtein in VB that uses ADODB. ... granting access rights to the resource to the ASP.NET request identity. ... If the application is impersonating via <identity ... Highlight the ASP.NET account, and check the ...
    (microsoft.public.dotnet.framework.aspnet)