使用 COM+ .Net Interop 64 位 Windows Server 2008 IIS 7 Server.CreateObject 的经典 ASP 失败 [英] Classic ASP using COM+ .Net Interop 64 Bit Windows Server 2008 IIS 7 Server.CreateObject Fails

查看:28
本文介绍了使用 COM+ .Net Interop 64 位 Windows Server 2008 IIS 7 Server.CreateObject 的经典 ASP 失败的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我遇到了一个与从运行 IIS7 的 64 位 Windows Server 2008 服务器上的经典 asp 应用程序执行 .Net dll 相关的问题.情况如下:

I am having an issue related to executing a .Net dll from a classic asp application on a 64 Bit Windows Server 2008 server running IIS7. The situation is as follows:

我编写了一个 .Net C# 程序集来执行一些加密任务.通过从 ServicedComponent 继承,此程序集可用于经典 ASP 环境,确保程序集信息文件具有 ComVisible(true) 属性,并且已使用regsvcs"命令行安装.

I have written a .Net C# assembly to perform some encryption tasks. This assembly has been made available to the classic ASP environment via inheriting from ServicedComponent, ensuring the assemblyinfo file has the ComVisible(true) attribute, and it has been installed using the "regsvcs" command line.

在我自己的桌面(运行 IIS6 的 XP)上测试时,一切正常.在迁移到 IIS 7、Windows Server 2008 时,我得到了臭名昭著的ASP 0177 Server.CreateObject failed".

When testing on my own desktop (XP running IIS6) everything worked fine. When moving to IIS 7, Windows Server 2008 I get the infamous "ASP 0177 Server.CreateObject failed".

我尝试了以下方法无济于事:

I have tried the following to no avail:

  1. 确保在服务器上安装了 ASP 和脚本扩展功能,因为这不是 IIS7 的默认设置.这使我能够执行简单的 ASP 命令,但不能为 .net 程序集执行 server.createobject.
  2. 为支持经典 asp 站点的应用程序池启用 32 位应用程序支持
  3. 使用 NetworkService 作为支持经典 asp 站点的应用程序池的标识
  4. 尝试使用 regsvr32 注册 dll,但失败
  5. 我能够创建其他对象,例如scripting.filesystemobject"
  6. 将 dll 移动到 wow64 目录,然后使用 regsvcs 注册它们.
  7. 是的,当我执行 regsvcs 命令时,它们是从RunAs"管理员启动的命令行中执行的.regsvcs 命令已成功注册来自 64 位和 32 位版本.但是,从经典的 asp 应用程序中使用时,它会失败.

这个问题与这个密切相关一个.但是,我认为这个问题更多地与在服务器上使用工具有关,而不是与我类似的编程问题.

This question is closely related to this one. However, I think this question was more related to using tools on the server as opposed to a programatic problem similiar to mine.

有人有更多的想法可以尝试吗?

Anyone have any more ideas to try?

推荐答案

经过这里的大量帮助和更多研究,我们终于找到了答案.为了解决我们的问题,我们执行了以下操作:

After a lot of help here and some more research, we finally came across the answer. To solve our issue we did the following:

  • 不再从 ServiceComponent 继承(这没关系,因为我们实际上并没有利用任何特定的 COM+ 功能)
  • 使用以下命令安装组件,必须按顺序完成:

  • No longer inherit from ServiceComponent (This is ok, since we are not actually leveraging any specific COM+ features)
  • Utilized the following commands to install the component, which must be done in order:

gacutil/i "C:InetpubwwwrootASPTest*dll 名称*"

gacutil /i "C:InetpubwwwrootASPTest*name of dll*"

regasm/tlb "C:InetpubwwwrootASPTest*dll 的名称*"

regasm /tlb "C:InetpubwwwrootASPTest*name of dll*"

此过程消除了原始错误,并且还具有能够在 IIS 运行时替换 dll 的额外好处.

This process eliminated the original errors and also had the added benefit of being able to replace the dll while IIS is running.

这篇关于使用 COM+ .Net Interop 64 位 Windows Server 2008 IIS 7 Server.CreateObject 的经典 ASP 失败的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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