System.UnauthorizedAccessException:检索 Word 互操作的 COM 类工厂失败并出现错误 80070005

System.UnauthorizedAccessException: Retrieving the COM class factory for Word Interop fails with error 80070005(System.UnauthorizedAccessException:检索 Word 互操作的 COM 类工厂失败并出现错误 80070005)
本文介绍了System.UnauthorizedAccessException:检索 Word 互操作的 COM 类工厂失败并出现错误 80070005的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在 Visual Studio 2008 中遇到了一个 C# ASP .NET 项目的问题当我用 Windows 7 Ultimate (x64) 重新安装我的电脑时,这个问题就开始了.为此,我也在使用 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.

我得到的错误信息是:

System.UnauthorizedAccessException:检索具有 CLSID {000209FF-0000-0000-C000-000000000046} 的组件的 COM 类工厂失败,原因是以下错误:80070005.在 xxx.Utility.WordDocument..ctor(字符串文件路径,HttpServerUtility util)在 c:xxxWebsitecustomercommunication.aspx.cs:line 127 中的 customer_communication.BuCreate_click(Object sender, EventArgs e) 处

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:xxxWebsitecustomercommunication.aspx.cs:line 127

推荐答案

这是我解决此问题的方法:

我使用的是 Win 7 64 位和 Office 2007

I'm using Win 7 64bit and Office 2007

运行程序dcomcnfg -32".(64位下找不到word和excel组件)

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".

完成后不要忘记按确定".: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 互操作的 COM 类工厂失败并出现错误 80070005的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!

本站部分内容来源互联网,如果有图片或者内容侵犯您的权益请联系我们删除!

相关文档推荐

DispatcherQueue null when trying to update Ui property in ViewModel(尝试更新ViewModel中的Ui属性时DispatcherQueue为空)
Drawing over all windows on multiple monitors(在多个监视器上绘制所有窗口)
Programmatically show the desktop(以编程方式显示桌面)
c# Generic Setlt;Tgt; implementation to access objects by type(按类型访问对象的C#泛型集实现)
InvalidOperationException When using Context Injection in ASP.Net Core(在ASP.NET核心中使用上下文注入时发生InvalidOperationException)
LINQ many-to-many relationship, how to write a correct WHERE clause?(LINQ多对多关系,如何写一个正确的WHERE子句?)