System.UnauthorizedAccessException的:检索COM类工厂的Word互操作失败,错误80070005。 [英] System.UnauthorizedAccessException: Retrieving the COM class factory for Word Interop fails with error 80070005.
问题描述
我在Visual Studio 2008中的C#ASP .NET项目中的问题 这个问题开始时,我重新安装我的电脑与Windows 7旗舰版(64位)。为了这个我还使用Office 2007的
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.
该错误消息我得到的是:
The error message I'm getting is:
System.UnauthorizedAccessException的:检索COM类工厂具有CLSID组件{000209FF-0000-0000-C000-000000000046}失败,原因是以下错误:80070005。 在xxx.Utility.WordDocument..ctor(字符串文件路径,HttpServerUtility UTIL) 在customer_communication.BuCreate_click(对象发件人,EventArgs e)在C:\ XXX \网站\用户\ 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
如果有人可以帮助我,我将依靠AP preciate吧。
If anyone can help me I would rely appreciate it.
推荐答案
这是我对这个问题的解决:
我使用的是Win 7的64位和Office 2007
I'm using Win 7 64bit and Office 2007
运行程序 DCOMCNFG -32 。 (你不能找到Word和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".
现在进入身份,然后选择交互式用户。
Now go to "Identity" and select "The interactive user".
不要忘了preSS确定完成时。 :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的:检索COM类工厂的Word互操作失败,错误80070005。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!