使用COM + .NET互操作程序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

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

问题描述

我有与从一个传统的ASP应用程序在64位Windows Server 2008服务器上运行的IIS7执行.NET动态库的问题。这种情况如下:

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:

我已经写了净C#组件来执行一些加密任务。该组件已提供给传统的ASP环境下通过从ServicedComponent中继承,保证了程序集信息文件的标记有ComVisible特性(真)的属性,它已被使用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.

在我自己的桌面上测试(XP上运行IIS6)一切都能正常工作。当移动到IIS 7,Windows Server 2008中,我得到了臭名昭著的ASP 0177 Server.CreateObject失败。

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命令,而不是对的Server.CreateObject .NET程序集。
  2. 的应用程序池支持传统的ASP网站已启用32位应用程序的支持
  3. 在使用网络服务作为应用程序池支持传统的ASP网站的身份
  4. 在尝试过注册的dll使用REGSVR32,它失败。
  5. 在我能够创建其他对象,如Scripting.FileSystemObject的
  6. 在移动的dll到WOW64目录中,然后使用regsvcs注册它们。
  7. 是的,当我一直在执行regsvcs命令他们已经从具有运行方式管理员启动的命令行。该regsvcs命令有registred成功 同时从64位和32位的版本。然而,从传统的ASP应用程序中使用时,它失败。
  1. Ensuring the ASP and Script Extension features were installed on the server, as this is not the default for IIS7. This allowed me to execute simple ASP commands, but not server.createobject for the .net assembly.
  2. Enabled 32 Bit application support for the app pool supporting the classic asp site
  3. Used NetworkService as the identity for the app pool supporting the classic asp site
  4. Tried registering dll using regsvr32, which failed
  5. I am able to create other objects such as "scripting.filesystemobject"
  6. Moving dll's to the wow64 directory and then using regsvcs to register them.
  7. And yes when I have been executing the regsvcs commands they have been from a command line launched with "RunAs" Administrator. The regsvcs commands have registred successfully from both the 64 and 32 bit versions. However, when used from the classic asp application, it fails.

这个问题是密切相关的<一个href="http://stackoverflow.com/questions/1208180/classic-asp-using-com-on-x64-windows-server-2008-and-iis7">this 之一。但是,我认为这个问题是更关系到使用的工具,而不是程序上的问题,类同矿在服务器上。

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 / IC:\的Inetpub \ wwwroot的\ ASPTest *的DLL *名

gacutil /i "C:\Inetpub\wwwroot\ASPTest*name of dll*"

regasm / TLBC:\的Inetpub \ wwwroot的\ ASPTest *的DLL *名

regasm /tlb "C:\Inetpub\wwwroot\ASPTest*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互操作程序64位Windows Server 2008 IIS 7的Server.CreateObject失败经典ASP的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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