System.UnauthorizedAccessException:检索Word Interop的COM类工厂失败,错误80070005 [英] System.UnauthorizedAccessException: Retrieving the COM class factory for Word Interop fails with error 80070005
问题描述
我在Visual Studio 2008中的C#ASP .NET项目有问题
当我用Windows 7 Ultimate(x64)重新安装计算机时,此问题开始。为此,我也使用Office2007。
I have a problem with a C# ASP .NET project in Visual Studio 2008 This problem started when I reinstalled my computer with Windows 7 Ultimate (x64). To this I'm also using Office 2007.
我收到的错误消息是:
System.UnauthorizedAccessException:检索具有CLSID {000209FF-0000-0000-C000-000000000046}的组件的COM类工厂由于以下错误而失败:80070005.
位于xxx.Utility.WordDocument。 .ctor(String filePath,HttpServerUtility util)
at customer_communication.BuCreate_click(Object sender,EventArgs e)在c:\xxx\网站\customer\communication.aspx.cs:第127行
System.UnauthorizedAccessException: Retrieving the COM class factory for component with CLSID {000209FF-0000-0000-C000-000000000046} failed due to the following error: 80070005. at xxx.Utility.WordDocument..ctor(String filePath, HttpServerUtility util) at customer_communication.BuCreate_click(Object sender, EventArgs e) in c:\xxx\Website\customer\communication.aspx.cs:line 127
推荐答案
这是我解决此问题的方法:
我正在使用Win 7 64位和Office 2007
I'm using Win 7 64bit and Office 2007
运行程序 dcomcnfg -32 。 (如果单词和excel组件运行在64位以下,则找不到该词)
Run program "dcomcnfg -32". ( You cant find the word and excel components if it runs under 64bit)
转到控制台根目录/组件服务/计算机/我的电脑/ DCOM配置/
查找Microsoft Word和Excel并选择属性。
Go to "Console Root/Component Services/Computer/My Computer/DCOM Config/" Look up Microsoft Word and Excel and choose properties.
转到安全性,然后在配置权限下选择自定义。(如果需要,您可能需要更改其他权限以及,但我不需要)
添加 IIS_IUSRS并赋予它完全控制权限。
Go to Security and select "Customize" under "Configuration Permissions. (If needed you might want to change the other permissions as well, but I didn't need to) Add "IIS_IUSRS" and give it "Full Control".
现在转到 Identity并选择交互式用户。
Now go to "Identity" and select "The interactive user".
完成后不要忘记按 OK。:D
Do not forget to press "OK" when done. :D
希望这对您有帮助,对其他人也有帮助。
I Hope this helps you with your problem and also the rest who gets here and read this.
这篇关于System.UnauthorizedAccessException:检索Word Interop的COM类工厂失败,错误80070005的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!