Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here


Microsoft: ASP.NET FAQ

ASP.Net Troubleshooting

Access is denied error using COM dll from ASP.Net by Antzz
Posted: 19 Nov 03 (Edited 19 Nov 03)

This is an error I encountered and had a tough time cracking it.

The Scenario:
I have an ActiveX dll(COM object) in VB6.
The Usage
(1)  I need to call the object directly from within ASP.Net page(through code behind)
(2)  I use the object in a .Net DLL and then use the .Net dll from within an ASP.Net page

The Result:
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.

What I tried:
(1) I tried modifying the Web.Config file and set <Identity Impersonate> tag to true. Didn't help.

(2) I went into Internet Services Manager too give permissions to the web site. Didn't help.

(3) I added all users to the COM dll file. Didn't help.

(4) I tried installing all SP for Windows. Didn't help.

(5) Tried everything that my friends here in the forum told me. Didn't work.

The Solution :
(1) The COM dll uses "msvbvm50.dll". Just add aspnet_wp user to the users and voila.
(2) There might be additional dlls that your application uses. Based on the situation, you will probably need to give permissions.

Hope this is helpful to you guys and save you lots of time.

Back to Microsoft: ASP.NET FAQ Index
Back to Microsoft: ASP.NET Forum

My Archive

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close