C# 在 DCOM 配置中找不到 Microsoft Word 文档
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/12300046/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Couldn't find Microsoft Word Document in DCOM Config
提问by Abdullah Darwish
I am creating a simple asp.net web site that use office 2007/2010 automation .. when i published the website on the iis 7 on my local machine (window 7) have an exception
我正在创建一个使用 office 2007/2010 自动化的简单 asp.net 网站..当我在本地机器(窗口 7)上的 iis 7 上发布网站时有一个例外
Retrieving the COM class factory for component with CLSID
{000209FF-0000-0000-C000-000000000046} failed due to the following error:
80080005 Server execution failed (Exception from HRESULT: 0x80080005
(CO_E_SERVER_EXEC_FAILURE)).
I have searched for this exception and i found that i have to set some permissions to office in DCOM Config.
我已经搜索了这个异常,我发现我必须在 DCOM Config 中设置一些权限到 office。
I have opened the component services and opened DCOM Config, but i have not found Microsoft Word Document i have found only office word 97 - 2003.
我打开了组件服务并打开了 DCOM Config,但我没有找到 Microsoft Word 文档,我只找到了 office word 97 - 2003。
can any one tell me how to solve this problem.
谁能告诉我如何解决这个问题。
回答by bfhd
Found the answer here: DCOM Failure of Office Automation
在这里找到答案:DCOM 办公自动化失败
If you are running a 64-bit server with 32-bit Office, you may have trouble finding this DCOM setting. You will need to run "MMC -32" from the command prompt to launch 32-bit MMC and then add 'Component Services' from the 'File > Add / Remove Snap-ins' menu.
如果您使用 32 位 Office 运行 64 位服务器,则可能无法找到此 DCOM 设置。您需要从命令提示符运行“MMC -32”以启动 32 位 MMC,然后从“文件 > 添加/删除管理单元”菜单中添加“组件服务”。
回答by Roman Plischke
Yes, office word 97 - 2003is a right name of DCOM document (resp. application) Word 2007 or 2010. Don't ask me why...
是的,office word 97 - 2003是 DCOM 文档(对应应用程序)Word 2007 或 2010 的正确名称。不要问我为什么...
Where could be the trouble?
哪里有问题?
The user must have access to desktop. If Word is called from ASP.NET, it has probably not this access. So set in dcomcnfg.exean account explicitly. Don't use The launching user(it is a IIS identity, it hasn't its own desktop) and don't use The interactive user(it works only if some user is logged in).
用户必须有权访问桌面。如果从 ASP.NET 调用 Word,则它可能没有此访问权限。所以在dcomcnfg.exe 中明确设置一个帐户。不要使用启动用户(它是一个 IIS 身份,它没有自己的桌面)并且不要使用交互式用户(它只有在某些用户登录时才有效)。
In my solution I have set:
在我的解决方案中,我设置了:
- I have created new user (in user group), called WordUser
- I have created in IIS new application pool with WordUser permission; Load User Profilemust be true
- DCOM I have set to use WordUser, on Securitytab I've added WordUser wit Launch and activation Permissionand Access Permission
- 我创建了新用户(在用户组中),名为 WordUser
- 我在 IIS 中创建了具有 WordUser 权限的新应用程序池;加载用户配置文件必须为true
- DCOM 我已经设置为使用 WordUser,在安全选项卡上我添加了 WordUser 机智启动和激活权限和访问权限
Maybe another way is possible, but this should work.
也许另一种方式是可能的,但这应该可行。

