By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
445,876 Members | 1,191 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 445,876 IT Pros & Developers. It's quick & easy.

calling a COM object in ASP.net

P: n/a
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

Nov 17 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
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).

--
Chris Jackson
Software Engineer
Microsoft MVP - Windows XP
Windows XP Associate Expert
--
More people read the newsgroups than read my email.
Reply to the newsgroup for a faster response.
(Control-G using Outlook Express)
--

"k" <ja***@unitechnetworks.com> wrote in message
news:eD**************@TK2MSFTNGP10.phx.gbl...
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

Nov 17 '05 #2

P: n/a
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 ?

"Chris Jackson" <chrisjATmvpsDOTorgNOSPAM> wrote in message
news:uh*************@TK2MSFTNGP11.phx.gbl...
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).
--
Chris Jackson
Software Engineer
Microsoft MVP - Windows XP
Windows XP Associate Expert
--
More people read the newsgroups than read my email.
Reply to the newsgroup for a faster response.
(Control-G using Outlook Express)
--

"k" <ja***@unitechnetworks.com> wrote in message
news:eD**************@TK2MSFTNGP10.phx.gbl...
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


Nov 17 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.