calling a COM object in ASP.net

  • Thread starter Thread starter k
  • Start date Start date
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
 
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).
 
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 ?
 
Back
Top