在使用CLSID {00024500-0000-0000-C000-000000000046}的组件检索COM类工厂失败,同时在任务调度程序中配置exe [英] Retrieving the COM class factory for component with CLSID {00024500-0000-0000-C000-000000000046} failed while configure exe in task scheduler

查看:982
本文介绍了在使用CLSID {00024500-0000-0000-C000-000000000046}的组件检索COM类工厂失败,同时在任务调度程序中配置exe的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经在C#中创建了控制台应用程序来读取Excel文件。
使用微软interop dll来操纵excel文件。
Excel文件是在Excel 2013中创建的。
.net版本是4.5
操作系统:windows server 2012

I have created console application in C# to read a Excel file. Used microsoft interop dll to manipulate excel file. The excel file is created in Excel 2013. .net version is 4.5 OS : windows server 2012

它将打开excel文件并添加带有值的行表。

It will open the excel file and add a row sheet with values.

功能正常。但是当我在任务调度程序中配置exe时,我收到一个错误。

The functionality is working fine. But when I configure the exe in task scheduler I am getting an error.


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

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

此外,我也尝试在具有相同用户凭据的命令提示符下运行exe用于在调度程序中配置任务。

Also I have tried to run the exe in command prompt with the same user credential which was used to configure the task in scheduler.

我的问题是,exe在命令提示符下工作正常,但不能在任务调度程序中工作。

My Question is, the exe working fine in the command prompt but not working in task scheduler.

任何想法

推荐答案

Option1: / strong>

Option1:

尝试以下步骤


  1. 在DCOMCNFG中,右键单击我的电脑,并选择属性。

  2. 选择COM证券标签

  3. 在访问权限中,单击编辑默认值,并向其添加网络服务,给它允许本地访问权限。对于\Users而言,执行相同操作。

  4. 在启动和激活权限中,单击编辑默认值,并向其中添加网络服务,并给予本地启动和本地激活权限。对于\Users

  1. In DCOMCNFG, right click on the My Computer and select properties.
  2. Choose the COM Securities tab
  3. In Access Permissions, click "Edit Defaults" and add Network Service to it and give it "Allow local access" permission. Do the same for \Users.
  4. In launch and Activation Permissions, click "Edit Defaults" and add Network Service to it and give it "Local launch" and "Local Activation" permission. Do the same for \Users

请查看链接如果有任何权限问题

Have a look into this link if there any permission problems

选项2:

如果找不到原因,只需将您的解决方案切换为保存AS方法

if you can't find the reason, just switch your solution as Save AS method

这篇关于在使用CLSID {00024500-0000-0000-C000-000000000046}的组件检索COM类工厂失败,同时在任务调度程序中配置exe的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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