C # Processing of "Access Denied" and "message filter display application in use" exception when reading word

Source: Internet
Author: User

Solution to the "Access Denied" and "message filter display application in use" error when creating the MS Office component in Asp.net

The "Access Denied" error occurs when Microsoft. Office. InterOP. Word. application is created in Asp.net.

 

In the project, open a Word template file on the server, modify its content, and then download it to the client for use. On the Asp.net page, create Microsoft. office. interOP. word. the error "Access Denied" is displayed when the application object is used. The message is as follows:

Access denied.
Note: An unhandled exception occurs during the execution of the current Web request. Check the stack trace information for details about the error and the source of the error in the code.
Exception details: system. unauthorizedaccessexception: Access denied.
ASP. NET is not authorized to access the requested resources. Consider granting the ASP. NET Request identity the permission to access this resource. ASP. NET has a base process ID used when the application is not simulated (typically, {MACHINE} \ ASPnet on IIS 5 and Network Service on IIS 6 ).
If the application is simulating through <identity impersonate = "true"/>, the identity will be an anonymous user (usually IUSR_machinename) or an authenticated user.
To grant ASP. NET write access to a file, right-click the file in resource manager, select "properties", and select the "Security" tab. Click Add to add an appropriate user or group. Highlight the ASP. NET account and select the corresponding access permission box.

1. Enter dcomcnfg in the command line to display the "component service" Manager.
2. Choose "component service"> "computer"> "my computer"> "DCOM configuration", find "Microsoft Word documents", right-click, and select "properties"
3. In the "properties" dialog box, click the "Security" tab, select "Custom" in "Start and activate Permissions", and click "edit" on the right ", in the displayed dialog box, add the "ASPnet" (netword service in IIS6) user, Grant "Local start" and "Local activation" permissions, and click "OK ".
4. In the "properties" dialog box, click the "Security" tab, select "Custom" in "Access Permissions", and click "edit" on the right ", in the displayed dialog box, add the "ASPnet" (netword service in IIS6) user, grant the "local access" permission, and click "OK" to close the "component service" Manager.

The message filter shows that the application is in use.
Note: An unhandled exception occurs during the execution of the current Web request. Check the stack trace information for details about the error and the source of the error in the code.
Exception details: system. runtime. interopservices. comexception: the message filter shows that the application is in use.

1. Enter dcomcnfg in the command line to display the "component service" Manager.
2. Choose "component service"> "computer"> "my computer"> "DCOM configuration", find "Microsoft Word documents", right-click, and select "properties"
3. In the "properties" dialog box, click the "ID" tab and select "Interactive User" to close the "component service" Manager.

 

If the problem persists after modification, right-click the component service> Computer> my computer and choose "Stop Ms DTC". Then restart the system.

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.