"Access Denied" and "Message Filter show application in use" exception processing occurs when reading Word in C #

Source: Internet
Author: User


1. "Access Denied" error occurred when establishing Microsoft.Office.Interop.Word.Application in ASP .

In the project, to implement a Word template file opened on the server side, modify its contents and then download it to the client, "Access denied" error when establishing the Microsoft.Office.Interop.Word.Application object in the ASP. The following information is indicated:

Access denied.
Description: An unhandled exception occurred during the execution of the current WEB request. Check the stack trace information For more information about the error and the source of the error in your code.
Exception Details: system.unauthorizedaccessexception: Access denied.
ASP. NET is not authorized to access the requested resource. Consider granting an ASP. NET request to identify permissions to access this resource. ASP. NET has a base process identity that is used when the application does not impersonate (typically, {machine}\aspnet on IIS 5, and Network Service on IIS 6).
If the application is impersonating by <identity impersonate= "true"/>, the identity will be the anonymous user (typically IUSR_machinename) or the authenticated requesting user.
To grant ASP. Write access to a file, in Explorer, right-click the file, select Properties, and then select the Security tab. Click Add to add the appropriate user or group. Highlight the ASP, and select the box that corresponds to the required access.

1. Enter: Dcomcnfg on the command line, which displays the Component Services Manager
2. Open "Component Services, computers, My Computer->dcom configuration", locate the "Microsoft Word document", right-click, select "Properties"
3. In the Properties dialog box, click the Security tab, select Custom at launch and activation permissions, click Edit on the right, and add "ASPNET" (Netword SERVICE in IIS6) user to the Pop-up dialog box, giving "local startup" and "Local activation" 's permissions, click OK
4. In the Properties dialog box, click the Security tab, select Custom from the Access permission, click Edit on the right, add "ASPNET" (Netword SERVICE in IIS6) user in the Pop-up dialog box, give local access permission, click OK , close the Component Services Manager.

2. "Access Denied" and "message Filter display application in use" errors are resolved when you create an MS Office component in ASP.

The message filter shows that the application is in use.
Description: An unhandled exception occurred during the execution of the current WEB request. Check the stack trace information For more information about the error and the source of the error in your code.
Exception Details: System.Runtime.InteropServices.COMException: Message Filter shows that the application is in use.

1. Enter: Dcomcnfg on the command line, which displays the Component Services Manager
2. Open "Component Services, computers, My Computer->dcom configuration", locate the "Microsoft Word document", right-click, select "Properties"
3. In the Properties dialog box, click the Identity tab, select Interactive User, and close the Component Services Manager.

If you haven't done so, right-click on the "Stop Ms DTC" service on my Computer, computer, Component Services, and then restart it.

"Access Denied" and "Message Filter show application in use" exception processing occurs when reading Word in C #

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.