使用CLSID {000209FF-0000-0000-C000-000000000046}检索组件的COM类工厂 [英] Retrieving the COM class factory for component with CLSID {000209FF-0000-0000-C000-000000000046}

查看:346
本文介绍了使用CLSID {000209FF-0000-0000-C000-000000000046}检索组件的COM类工厂的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用Windows XP_SP_3和IIS 5(本地主机),使用asp.net4构建网站并使用此代码:

i use Windows XP_SP_3 and IIS 5 (local host), build site with asp.net4 and use this code:

Application appClass = new Application();
Document wordDoc = appClass.Documents.Add(Server.MapPath("~") + @"Files\tmp.docx");
wordDoc.SaveAs(@"e:\hp\Files\" + TextBox1.Text + ".docx");
wordDoc.Close();

如果使用VS2010运行网站,则可以。但如果使用IIS 5(本地主机)运行,则显示以下错误:

if run site with VS2010, its OK. but if run with IIS 5 (Local Host), show this error:


检索具有CLSID {000209FF-0000的组件的COM类工厂由于以下错误,-0000-C000-000000000046}失败:80070005访问被拒绝。 (来自HRESULT的异常:0x80070005(E_ACCESSDENIED))。

Retrieving the COM class factory for component with CLSID {000209FF-0000-0000-C000-000000000046} failed due to the following error: 80070005 Access is denied. (Exception from HRESULT: 0x80070005 (E_ACCESSDENIED)).

描述:执行当前Web请求期间发生了未处理的异常。请查看堆栈跟踪以获取有关错误及其源自代码的位置的更多信息。

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.

异常详细信息:System.UnauthorizedAccessException:由于以下错误,检索CLSID为{000209FF-0000-0000-C000-000000000046}的组件的COM类工厂失败:80070005访问被拒绝。 (来自HRESULT的异常:0x80070005(E_ACCESSDENIED))。

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 Access is denied. (Exception from HRESULT: 0x80070005 (E_ACCESSDENIED)).

ASP.NET无权访问所请求的资源。考虑将资源的访问权限授予ASP.NET请求标识。 ASP.NET具有基本进程标识(IIS 5上通常为{MACHINE} \ ASPNET,IIS 6和IIS 7上为网络服务,IIS 7.5上已配置的应用程序池标识),如果应用程序未模拟,则使用该标识。如果应用程序模拟通过,则标识将是匿名用户(通常为IUSR_MACHINENAME)或经过身份验证的请求用户。

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 and IIS 7, and the configured application pool identity on IIS 7.5) that is used if the application is not impersonating. If the application is impersonating via , the identity will be the anonymous user (typically IUSR_MACHINENAME) or the authenticated request user.

要授予对文件的ASP.NET访问权限,请在资源管理器中右键单击该文件,选择属性,然后选择安全选项卡。单击添加以添加适当的用户或组。突出显示ASP.NET帐户,并选中所需访问的框。

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.

源错误:

在执行当前Web请求期间生成了未处理的异常。可以使用下面的异常堆栈跟踪来识别有关异常的起源和位置的信息。

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.






我打开组件服务>计算机>右键单击我的电脑>选择属性> COM Sucrity>启动和激活...>编辑默认>添加>高级>


I open Component Service > Computer > right click in My Computer > choose Properties > COM Sucrity > Launch and Activation... > Edit Default > Add > Advanced >

我找不到用户IIS(IIS_IUSRS)。所以选择ASP.NET并确定并选中Local Launch&远程启动&本地激活&远程激活。

i not Find User IIS (IIS_IUSRS). so Choose ASP.NET and ok and Check Local Launch & Remote Launch & Local Activation & Remote Activation.

休息系统并再次使用iis5运行站点。但是再次显示错误!

rest System and run site with iis5 again. but show error previous again!

推荐答案


  1. 转到控制面板 - >管理工具 - >组件
    服务

  2. 通过单击组件服务扩展树 - >
    计算机 - >我的电脑 - > DCOM配置

  3. 搜索CLSId
    00020906-0000-0000-C000-000000000046 (用于单词申请)
    注意:如果找不到搜索CLSId,则搜索Windows Word应用程序。

  4. 通过选择
    00020906-0000-0000-C000-000000000046 ,此CLSId现在右键单击属性

  5. 在Propeties区域中,单击Security TAB。

  6. 从所有选项中选择自定义选项(启动和激活
    权限,访问权限,配置权限)。

  7. 全部添加新名称NETWORK SERVICE,并允许
    此名称的所有权限。

  8. 转到同一身份标签属性区域,选择
    选项作为此用户,然后添加用户名(本机的
    管理员)和密码。点击Apply,Ok。

  9. 刷新组件服务并检查您的应用程序是否正常工作
    罚款。

  1. Goto Control panel -> Administrative Tools -> Component Services
  2. Expand Tree by clicking on Component Services -> Computers -> My Computer -> DCOM Config
  3. Search CLSId 00020906-0000-0000-C000-000000000046 (which is for word application) Note: If Search CLSId not finds then search by "Windows Word Application".
  4. By selecting 00020906-0000-0000-C000-000000000046 this CLSId now right click on Properties
  5. In the Propeties area, click on Security TAB.
  6. Select Customize option from all (Launch and Activations Permissions, Access Pemissions, Configuration Permissions).
  7. Add new name as NETWORK SERVICE in all, and Allow all permissions for this name.
  8. Go to Identity TAB in the same properties area, select option as a This user and then add username (which is administrator of this machine) and password. Click on Apply, Ok.
  9. Refresh Component Services and check your application is working fine or not.

这篇关于使用CLSID {000209FF-0000-0000-C000-000000000046}检索组件的COM类工厂的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆