由于以下错误,检索具有CLSID {000209FF-0000-0000-C000-000000000046}的组件的COM类工厂失败:80070005。 [英] Retrieving the COM class factory for component with CLSID {000209FF-0000-0000-C000-000000000046} failed due to the following error: 80070005.

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

问题描述

我知道如果我在谷歌搜索,上面提到的错误将得到解释,



但不幸的是,没有一个解决方案适合我。



我认为它有一些许可问题



我的代码在本地工作正常,但上传到服务器时将显示此错误



服务器:Windows Server,Service Pack 1



IIS:IIS 7



我的代码打开word文档,编辑然后保存



I know the error mentioned above will get explanation if I search in google,

But unfortunately, none of the solutions worked for me.

I think its some permission issue

My code is working fine locally,but when upload to server will show this error

Server : Windows Server,Service Pack 1

IIS : IIS 7

My Code to open a word document,edit it and then save

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Microsoft.Office;
using Microsoft.Office.Interop.Word;
using System.Net;
using System.IO;
using System.Text;
using System.Threading;

public partial class Admin_Download : System.Web.UI.Page
{
    CCWordApp test = new CCWordApp();

    protected void Page_Load(object sender, EventArgs e)
    {

    }
    protected void LinkButton30_Click(object sender, EventArgs e)
    {
        try
        {

            test.Open(@"D:\test.doc");
            test.InsertText("Today is a holiday");
            test.SaveAs(@"D:\test.doc");
            test.Quit();

        }
        catch (Exception ex)
        {
            TextBox1.Text = ex.Message;
        }

    }


}





错误显示







Error Showing


Server Error in application /.
 
Retrieving the COM class factory for component with CLSID {000209FF-0000-0000-C000-000000000046} failed due to the following error: 80070005.
 
Description: An unhandled exception occurred during the execution of the current web. Please review the stack trace for more information about the error and where it originated in the code.
 
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.
 
ASP.NET does not have permission to access the requested resource. Try access rights to the resource to grant the ASP.NET request identity. ASP.NET has a base process identity (typically {MACHINE} \ ASPNET on IIS 5 or Network Services on IIS 6) that is used if the application is not impersonating. If the application is impersonating via <identity impersonate="true"/>, the identity of the anonymous user (typically IUSR_MACHINENAME) or the authenticated request user.
 
You can grant ASP.NET access to a file by right-clicking on the file in Explorer, Properties and select the Security tab. Click Add to select the user or group to add. Highlight the ASP.NET account, and check the boxes for the desired access.
 
Source Error:
 

Line 10: public class CCWordApp
Line 11: {
Line 12: public Word.ApplicationClass oWordApplic Word.ApplicationClass = new (); / / a reference to Word application
Line 13: public Word.Document oDoc = new Word.Document ();
Line 14: public CCWordApp ()
 
Source File: e: \ Websites \ DDPPortal \ App_Code \ CCWordApp.cs Line: 12
 
Stack Trace:
 

[UnauthorizedAccessException: Retrieving the COM class factory for component with CLSID {000209FF-0000-0000-C000-000000000046} failed due to the following error: 80070005.]
   CCWordApp .. ctor () in E: \ Websites \ DDPPortal \ App_Code \ CCWordApp.cs: 12
   Admin_Download .. ctor () in E: \ Websites \ DDPPortal \ Admin \ Download.aspx.cs: 15
   ASP.admin_download_aspx .. ctor () in c: \ Windows \ Microsoft.NET \ Framework \ v2.0.50727 \ Temporary ASP.NET Files \ root \ 8ad6eae3 \ a1c8e081 \ App_Web_yjjwtzfk.2.cs: 0
   __ASP.FastObjectFactory_app_web_yjjwtzfk.Create_ASP_admin_download_aspx () In c: \ Windows \ Microsoft.NET \ Framework \ v2.0.50727 \ Temporary ASP.NET Files \ root \ 8ad6eae3 \ a1c8e081 \ App_Web_yjjwtzfk.6.cs: 0
   System.Web.Compilation.BuildResultCompiledType.CreateInstance () +32
   System.Web.Compilation.BuildManager.CreateInstanceFromVirtualPath (Virtual Path virtual path, type required base type, HttpContext context, Boolean allowCrossApp, Boolean noAssert) 119
   System.Web.UI.PageHandlerFactory.GetHandlerHelper (HttpContext context, String request type, VirtualPath virtual path, physical String path) +33
   System.Web.UI.PageHandlerFactory.GetHandler (HttpContext context, String request type, virtual String path, String path) 37
   System.Web.MaterializeHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute () 307
   System.Web.HttpApplication.ExecuteStep (IExecutionStep step, Boolean & completedSynchronously) 155
 
Version Information: Microsoft. NET Framework Version: 2.0.50727.3603; ASP.NET Version: 2.0.50727.3614











有人能帮帮我吗?或者我该如何解决这个问题

任何帮助都会感激不尽。







Kishore






Could anyone help me? or how can I solve this
Any help will be thankfull.



Kishore

推荐答案

您好,



看看这里:

http://indiandeve.wordpress.com/2009/11/03/dcom-error-retrieving-the-com-class-factory- for-component-with-clsid-000209ff-0000-0000-c000-000000000046-failed-due-to-the-following-error-80070005 / [ ^ ]


CodeProject拥有的英语用户多于荷兰用户,所以这可能是一个好主意翻译错误在发布之前发送给英语的消息。



我相信答案在于错误消息的第四和第五段:

CodeProject has more English users than Dutch users, so it might be a good idea to translate the error message to English before posting it.

I believe the answer lies in the fourth and fifth paragraphs of the error message:
ASP.NET无权访问所请求的资源。尝试访问资源以授予ASP.NET请求标识。 ASP.NET具有基本进程标识(在IIS 5上通常为{MACHINE} \ ASPNET,在IIS 6上为网络服务),如果应用程序未模拟,则使用该标识。如果应用程序通过< identity impersonate =true>模仿,则匿名用户(通常为IUSR_MACHINENAME)或经过身份验证的请求用户的身份。



您通过在资源管理器,属性中右键单击该文件并选择安全选项卡,可以授予对文件的ASP.NET访问权限。单击添加以选择要添加的用户或组。突出显示ASP.NET帐户,并选中所需访问的框。
ASP.NET does not have permission to access the requested resource. Try access rights to the resource to grant the ASP.NET request identity. ASP.NET has a base process identity (typically {MACHINE} \ ASPNET on IIS 5 or Network Services on IIS 6) that is used if the application is not impersonating. If the application is impersonating via <identity impersonate="true">, the identity of the anonymous user (typically IUSR_MACHINENAME) or the authenticated request user.

You can grant ASP.NET access to a file by right-clicking on the file in Explorer, Properties and select the Security tab. Click Add to select the user or group to add. Highlight the ASP.NET account, and check the boxes for the desired access.





如果您在开发计算机上拥有本地管理员权限或使用相同的权限帐户创建Word文档和运行ASP。在服务器上,您通常使用仅具有必要权限的帐户来运行网站/ Web服务。找出您在服务器上使用的帐户,并为该帐户授予必要的权限。



If you have local admin rights on your dev machine or used the same account for creating the Word doc and running ASP. On the server, you typically use an account with only the necessary permissions to run the websites/webservices. Find out which account you use on the server and give that account the necessary permissions.


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

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