连接到一个COM接口,一个aspx code隐藏在IIS上运行? [英] Connecting to a COM interface in an aspx code-behind running on IIS?

查看:109
本文介绍了连接到一个COM接口,一个aspx code隐藏在IIS上运行?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我创建了一个Windows服务(基于Visual Studio的AT​​L向导exe文件),它公开了一个COM接口。运行作为一个进程内服务器或Windows服务没有问题。我需要一个Windows服务,因为我需要一些流程是IIS连接提供外面。

I've created a Windows service (an exe based on the Visual Studio ATL wizard) which exposes a COM interface. No problems running as an in-proc server or a Windows service. I need a Windows service since I need some processes to be available outside of IIS access.

我已经创造了一些网页(ASPX / C#)打电话给我的服务,一切都在Visual Studio .NET开发服务器中正常工作测试。现在,我试图把网页,IIS 7进行进一步的测试(在Windows 7上运行)。但是,当页面下运行IIS的调用我的COM接口的所有失败,错误

I've been creating some web pages (aspx/C#) calling my service and everything has worked fine testing within the Visual Studio .NET Development Server. Now, I'm trying to push the web pages to IIS 7 (running on windows 7) for further testing. But, when the pages are running under IIS the calls to my COM interface all fail with the error

检索COM类工厂组件失败,原因是出现以下错误:80070005访问被(从HRESULT异常:0X80070005(E_ACCESSDENIED))否认了。

"Retrieving the COM class factory for component failed due to the following error: 80070005 Access is denied. (Exception from HRESULT: 0x80070005 (E_ACCESSDENIED))."

我已经验证的服务是:


  • 在HKCR \\ CLSID \\在Windows中注册(注意,我注册运行myservice.exe / RegServer添加,因为regsvr32.exe的只适用于动态链接库)

  • 对于IIS_IUSRS用户
  • myservice.exe已经阅读并执行权限

  • 是一个64位的EXE(所以应在默认的IIS应用程序池空间加载)

  • 作品在.NET发展论坛服务器调试很大(但不是IIS)

任何想法,为什么这是行不通的?是与包含在一个exe VS DLL COM接口?

Any ideas why this would not work? Something to do with the COM interfaces contained in an exe vs dll?

IIS的调用Windows服务暴露一个COM接口的任何possibilites?

Any possibilites of IIS calling a COM interface exposed in a Windows service?

推荐答案

我相信你需要授予访问你的网站的应用程序池过程中使用的COM对象,下DCOM配置。

I believe you need to grant access to your site's app pool process to use your COM object, under DCOM Config.


  • 转至组件服务

  • >计算机>我的电脑> DCOM配置分支

  • 找到列表中的您的服务的AppID或名称。右键单击它并选择属性。

  • 打开安全标签

  • 选择启动和激活权限,并选择自定义。

  • 授予应用程序池进程(可能ASPNET,但检查您的网站的IIS应用程序池属性)如下:本地启动和本地激活

请让我们知道,如果这能解决你的问题。

Please let us know if this solves your problem.

顺便说一句:

> is a 64bit exe (so should load in the default IIS app-pool space)

这并不完全正确。应用程序池是一个ISS控制的过程。您的服务在它自己单独的进程中运行不管。所以,你的服务无关与IIS应用程序池。

That's not quite true. The app pool is an ISS-controlled process. Your service runs on its own separate process no matter what. So your service has nothing to do with IIS app pools.

这篇关于连接到一个COM接口,一个aspx code隐藏在IIS上运行?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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