After the Asp.net application is released, the Excel File Import and Export solution reports an error.

Source: Internet
Author: User

Message: SYS. webforms. pagerequestmanagerservererrorexception: retrieving the com class factory for component with clsid {00024500-0000-0000-c000-000000000046} failed due to the following error: 80070005 access is denied. (Exception from hresult: 0x80070005 (e_accessdenied )).

In Asp.netProgramThe Excel file can be imported and exported normally. However, the preceding error occurs after being published to IIS. It was a hard task to make the best effort. Some netizens proposed the following solutions:


First: (can be implemented)

Click Start-run-input: dcomcnfg on the server and press Enter. The Distributed COM Configuration Attribute form is displayed.

On the Application page, select Microsoft Excel application ". Click "properties". The application's property form is displayed.

On the "General" Page, select "NONE" from the authentication level drop-down list ".

On the "Security" Page, select "use custom Access Permissions" and "use custom start Permissions", and then click the "edit" button corresponding to the access user and start user respectively, add the user "everyone" in it ".

Finally, select "Interactive User" on the "ID" page ".

Second: (can be implemented)

Add the following configuration to <system. Web> in Web. config:

<Identity impersonate = "true" username = "[computer logon username]" Password = "[Password]"/>.

This method is not recommended for the following reasons:

If the login user's password changes, an error will be reported, and it is not safe to write the login password in Web. config.

Implementation Method of explain:

The above two methods can be implemented, but I still want to talk about my views:

First, why is this error?

This is because the user group "Network Service" is used to access the website. You cannot see the User Name of the Process (w3wp.exe) in the Migration Task Manager (administrator ).

W3wp.exe --Worker.

This process is used to allocate a large amount of system resources. This process is of great significance to the stability and security of the system and cannot be ended easily.

W3wp.exe --The user is the system's built-in security account network service.

W3wp.exe --The normal path of is % WINDIR % \ system32 \ inetsrv, generally in c: \ windows \ system32 \ inetsrv

This error occurs because the "Network Service" User Group has no permissions to start, activate, and access excel. Now that you know the reason, it's easy.

The solution is as follows:

Similar to the first method above, the only difference is that the network service user group is added instead of the Everyone user group.

You do not need to modify the selection in the authentication level drop-down list on the "General" page., "Default. Note: On the "ID" Page, select "Interactive User". Otherwise, an error may occur.

 

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.