Use Excel's permission settings in asp.net

Source: Internet
Author: User
Tags stack trace

When you use Excel in ASP.net, you first need to set permissions on the COM component. If permissions are not set, the access denied error is reported. Detailed error messages are usually as follows:

Note: An unhandled exception occurred during the execution of the current WEB request. Check the stack trace for more information about the error and where the error occurred in the code.

Exception Details: system.unauthorizedaccessexception: Access denied.

ASP.net is not authorized to access the requested resource. Consider granting the ASP.NET request identity access to this resource. ASP.net has a base process identity that is used when the application has no impersonation (typically, on IIS 5, on IIS 6 for network services). If the application is being emulated, the identity will be anonymous (typically IUSR_machinename) or authenticated request users.

To grant ASP.net write access to a file, right-click the file in Explorer, select Properties, and then select the Security tab. Click Add to add the appropriate user or group. Highlight the ASP.net account, and select the box that corresponds to the required access rights.

The way to set permissions is to enter DCOMCNFG in the Windows Run box and turn on COM management. In the security of Excel applications, add access, run, and configure permissions for users such as ASPNET, Iuser, IWAM, and so on.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.