Click here to Skip to main content
15,887,683 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Several months ago, I posted a thread at Error: Retrieving the COM class factory for component with CLSID {0006F03A-0000-0000-C000-000000000046} failed due to the following error: 80070005[^]
But unfortunately, I have received few feedback. The scenario is that in an asp.net project, I want to send an email alert through Outlook. It is fine if I run the the Debugging. But when I deploy it in an IIS 6.5/7.5 server, I receive the error:
HTML
Retrieving the COM class factory for component with CLSID {0006F03A-0000-0000-C000-000000000046} failed due to the following error: 80070005 Access is denied. (Exception from HRESULT: 0x80070005 (E_ACCESSDENIED)).
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: Retrieving the COM class factory for component with CLSID {0006F03A-0000-0000-C000-000000000046} failed due to the following error: 80070005 Access is denied. (Exception from HRESULT: 0x80070005 (E_ACCESSDENIED)). 
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 and IIS 7, and the configured application pool identity on IIS 7.5) 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. 
To grant ASP.NET access to a file, right-click the file in File 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.

In my IIS Authentication setting, there is only 'Anonymous Authentication' there, group by: No Grouping, and Status enabled. The 'Anonymous Authentication Credentials' is set as 'IUSR' for the 'Anonymous User Identification'.
Hopefully, I can get some advisory from experienced developers this time. Thanks for your reviewing.
Posted

1 solution

This is a permissions issue. Ensure the IUSR account have access to office components.
 
Share this answer
 
Comments
[no name] 26-Mar-14 15:41pm    
I opened Component Services (by cmd DCOMCNFG). In the Computer\My Computer\DCOM Config\, I couldn't find the component: {0006F03A-0000-0000-C000-000000000046}. But my Outlook works fine.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900