calling a COM object in ASP.net

K

k

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.

I've an application working fine, but when I changed it into an ASP.NET, it
has security exception. How can I solve it ?

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 18: public class WebForm1 : System.Web.UI.Page
Line 19: {
Line 20: KTRANSENGINELib.KingTransEngine trans = new
KTRANSENGINELib.KingTransEngineClass();
Line 21: KTRANSENGINELib.KingTransEngine transc = new
KTRANSENGINELib.KingTransEngineClass();
Line 22: protected System.Web.UI.WebControls.Label Label1;


Source File: c:\inetpub\wwwroot\translation\webform1.aspx.cs Line: 20
 
C

Chris Jackson

ASP.NET runs under a different security account than IIS does, so you need
to grant permissions to that object to the ASPNET account (or whatever
account you are running ASP.NET under, as specified in your machine.config).
 
K

k

But I've already grant {mymachine}\ASPNET as Administrator rights. Is it
related my XP is participated in a workgroup, not a domain ?
Do you have any suggestion ?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top