Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

COM Exception 1

Status
Not open for further replies.

tjherman

Programmer
Jun 19, 2006
68
US
I want to be able to automate a word document from my ASP.NET application and I have to use the Microsoft Word Object library (Interop.Word) which is a COM class. Having refrenced it and all, the application runs perfectly in the Visual Studio 2005 environment and I have no problems at all. Now, with all files transfered to the IIS virtual folder, and trying to create the Word Application object throws up the following exception:


Retrieving the COM class factory for component with CLSID {000209FF-0000-0000-C000-000000000046} failed due to the following error: 80070005.
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 {000209FF-0000-0000-C000-000000000046} failed due to the following error: 80070005.

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) 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 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.
****
Does anyone have any ideas?

 
Have you set the DCOM launch and execute permissions for the user?


____________________________________________________________

Need help finding an answer?

Try the Search Facility or read FAQ222-2244 on how to get better results.

 
No, I haven't done this. Can you describe how you go about this and where it is set at? Does it need to be specific for each user?
 
I've found some instructions on setting this and will give it a try!
 
Type "dcomcnfg" into the Run command box to launch the console.

You then have to browse down to your computer in Component Services and set the launch and execute permissions for the relevant application (although I can't remember what it is called for Word, but Excel is something like "Microsoft Excel Application" so I imagine it will be something similar and you'll just have to have a play around with it).




____________________________________________________________

Need help finding an answer?

Try the Search Facility or read FAQ222-2244 on how to get better results.

 
Thank you very much! This fixed my security problem!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top