错误ASP 0177:8007007E的Server.CreateObject失败COM DLL [英] Error ASP 0177: 8007007e Server.CreateObject fails for COM DLL

查看:484
本文介绍了错误ASP 0177:8007007E的Server.CreateObject失败COM DLL的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们一直试图在新服务器上安装一个COM DLL。该接口是传统的ASP。该地图连接器DLL似乎是问题,不过这是因为据我能够得到。

我们无法获得通过IIS服务的网页给予比500错误的任何其他。

在跟踪ASP:


127. -ASP_SCRIPT_TRACE_COM_CALL_END
文件路径
C:\\ INETPUB \\ wwwroot的\\ MILER \\ GLOBAL.ASA电话号码
6CurrentStatement
设置g_pcmsrv =的Server.CreateObject(PCMServer.PCMServer)SizeOfStatement
55
0毫秒
128. -ASP_LOG_ERROR
电话号码
6错误code
ASP 0177:8007007E描述
Server.CreateObject失败

该DLL是 PCMSRV32.DLL C:\\ WINDOWS

GLOBAL.ASA:

  Application_OnStart的分
设置g_pcmsrv =的Server.CreateObject(PCMServer.PCMServer)
一套应用程序(g_pcmsrv)= g_pcmsrv设置g_pcmmapmgr =的Server.CreateObject(Pcmgole.PCMMapMgr)
一套应用程序(g_pcmmapmgr)= g_pcmmapmgr
结束小组子的Session_OnStart
设置会议(currentTrip)=申请(g_pcmsrv)。NewTrip(NA)
设置会议(地图)=申请(g_pcmmapmgr)。createMap()
结束小组子的Session_OnEnd
设置会议(currentTrip)=没有
设置会议(图)=无
结束小组子Application_Onend
设置应用程序(g_pcmsrv)=没有
设置应用程序(g_pcmmapmgr)=没有
结束小组


解决方案

是什么原因导致这个错误?


  

Server.CreateObject失败


是最常见的,当Web应用程序从一个Web服务器转移到另一个没有造成正在使用外置COM组件的理解,并与Web服务器注册。


  

<子>从 PRB:返回的Server.CreateObject 500.100 HTTP或ASP 0177错误(0x8007007E )


  
  

当您尝试使用时出现此错误在的Server.CreateObject 方式来实例化未在本地系统上注册的对象。


确定错误的来源

如果您使用的是ASP Web应用程序内部的COM组件,你会看到这样的行

设置g_pcmsrv =的Server.CreateObject(PCMServer.PCMServer)

通常情况下,错误将指向设置行,这使得确定的原因更容易的(幸运的是,你在地方一些很好的跟踪code所以它甚至更好)

如果你不知道在哪里DLL位于?


  

注意:请访问Windows注册表的时候,因为它是很容易在不经意间做出对操作系统和在极端情况下的严重后果,需要一个系统恢复或重新安装的变化要小心/维修。


的CreateObject 方法中的字符串被称为一个的ProgId ,并用作标识符里面的关键Windows注册表,可以在里面找到


  

注意: Windows注册表可以在大多数Windows版本中使用 REGEDIT.EXE 也被称为注册表编辑器浏览。使用这个工具来浏览Windows注册表时要非常小心。


HKEY_CLASSES_ROOT

和推而广之。

HKEY_LOCAL_MACHINE \\ Classes下

每当ASP处理器遇到的ProgId 它试图聊到Windows注册表,发现表示注册的COM访问DLL的位置对应的按键。

HKEY_CLASSES_ROOT \\ PCMServer.PCMServer

这一种常见的方法是关键中含有一种叫 CLSID 子项,它指向类GUID为相关注册DLL。一旦GUID键位于

HKEY_CLASSES_ROOT

蜂巢它可用于通过查看子找到位置

HKEY_CLASSES_ROOT \\ {GUID从CLSID} \\ InprocServer32的

在这里的位置将被存储在(默认)值。


  

示例使用的ProgId - Scripting.FileSystemObject的


  
  

      
  1. 找到 Scripting.FileSystemObject的子项中的 HKEY_CLASSES_ROOT


      
      

    HKEY_CLASSES_ROOT \\ Scripting.FileSystemObject的


  2.   
  3. 从子项中确定的GUID CLSID


      
      

    HKEY_CLASSES_ROOT \\ Scripting.FileSystemObject的\\ CLSID(默认) - {0D43FE01-F093-11CF-8940-00A0C9054228}


  4.   
  5. 使用GUID找到 HKEY_CLASSES_ROOT

    注册DLL子项
      
      

    HKEY_CLASSES_ROOT \\ {0D43FE01-F093-11CF-8940-00A0C9054228}


  6.   
  7. 检查子项的InprocServer32 (默认)为DLL位置值


      
      

    HKEY_CLASSES_ROOT \\ {0D43FE01-F093-11CF-8940-00A0C9054228} \\ InprocServer32的(默认) - C:\\ WINDOWS \\ SYSTEM32 \\的scrrun.dll


  8.   

的ProgId PCMServer.PCMServer 在注册表中?

如果您无法找到相应的的ProgId 在注册表中它可能是由于一两个原因,我们将在这里阐述一下。


  1. 的DLL没有注册。

  2. 注册该DLL,在错误的地方。

如何注册COM DLL与Windows

COM的DLL可以注册并运行从Windows命令的的regsvr32.exe 工具创建相应的注册表项提示符下使用提升的权限的(这从不同版本的Windows版本)

在我们继续,虽然这两个操作系统和ASP Web应用程序使用的模式的架构是非常重要的。

大多数较新的硬件是64位这造成了一个难题在Windows中,因为它现在已经支持新的64位架构,仍然保持了32位架构的支持。微软想出了解决的办法是操作系统一分为二,所以我们有64位元素和32位元素。主要的OS程序被分解成两个文件夹中的(仅适用于64位操作系统,因为32位操作系统不具有64位抗衡,即使硬件是可以做到这一点)


  

注意:在32位的系统只使用64位的位置为系统文件和注册表


在一个64位操作系统的系统程序位于


  1. 有关32位程序

    的%SystemRoot%\\ SYSTEM32 \\


  2. 有关64位程序

    的%SystemRoot%\\ Syswow64资料\\


此也适用于Windows注册表


  1. 32位

    HKEY_CLASSES_ROOT


  2. 64位

    HKEY_CLASSES_ROOT \\ Wow6432Node


因此​​,例如,在Windows的64位版本,下面的命令将在32位注册表注册 PCMSRV32.DLL 并创建关联的COM DLL注册表项。

C:\\ WINDOWS \\ Syswow64资料&GT; REGSVR32C:\\ WINDOWS \\ PCMSRV32.DLL

IIS应用程序池

作为一切开始支持64位,包括IIS,你仍然需要能够支持仅支持32位COM遗留应用程序,所以IIS在IIS 6.0中引入的(启动与Windows Server 2003 Service Pack 1起)<根据应用程序池设置/ em>的可配置属性 Enabled32BitAppOnWin64 ,它允许应用程序池在32位模式在Windows 64位版本上运行。

考虑到这一点,你注册COM DLL知道在哪里,你应该注册它,你需要知道在32位模式的应用程序池是否正在运行之前。在IIS 7.0及以上的用户可于IIS管理器应用程序内的应用程序池属性检查。该设置是在高级设置常规部分,被称为启用32位应用程序(也可以在配置的的applicationHost.config 使用 enable32BitAppOnWin64 下在&LT; ApplicationPools方式&gt; 部分)


  • 如果启用32位应用程序设置为

    IIS应用程序池在纯64位模式下运行,并且需要由ASP Web应用程序可以使用任何COM DLL文件将需要支持64位,并使用 REGSVR32的64位版本注册.EXE 添加到64位注册表。

    C:\\ Windows \\ System32下&GT; REGSVR32C:\\ WINDOWS \\ PCMSRV32.DLL


  • 如果启用32位应用程序设置为

    IIS应用程序池在32位模式下运行,并且需要由ASP Web应用程序可以使用任何COM DLL文件将需要32位COM DLL和使用 32位版本注册regsvr32.exe的添加到32位注册表。

    C:\\ WINDOWS \\ Syswow64资料&GT; REGSVR32C:\\ WINDOWS \\ PCMSRV32.DLL


注册COM DLL使用的regsvr32.exe 的错误版本

例如使用

C:\\ WINDOWS \\ Syswow64资料&GT; REGSVR32C:\\ WINDOWS \\ PCMSRV32.DLL

在Windows的64位版本的32位注册表中注册COM DLL时,IIS应用程序池是不是在32位模式将导致ASP 500.100 内部服务器错误


  

服务器对象错误ASP 0177:8007007E


  
  

Server.CreateObject失败



COM DLL清单


  1. 什么是IIS应用程序池高级设置启用32位应用程序设置为,因为你如何注册COM DLL影响?


  2. 是DLL使用架构的regsvr32.exe 的特定版本注册的(如果Windows版本是不是64位使用默认)反映启用32位应用程序?


  3. 请问Windows注册表包含的ProgId 中的结构具体位置的DLL

    HKEY_CLASSES_ROOT

    这反映出的设置使32位应用程序


  4. 请问的InprocServer32 键包含对DLL的正确位置?



相关链接

We have been trying to install a COM DLL on a new server. The interface is Classic ASP. The Map Connector DLL seems to be the problem but that is as far as I am able to get.

We are unable to get the pages served by IIS to give anything other than a 500 error.

When tracing the ASP:

127.  -ASP_SCRIPT_TRACE_COM_CALL_END 


FilePath
C:\INETPUB\WWWROOT\MILER\GLOBAL.ASA 

LineNumber
6 

CurrentStatement
set g_pcmsrv=Server.CreateObject("PCMServer.PCMServer") 

SizeOfStatement
55 


0 ms


128.  -ASP_LOG_ERROR 


LineNumber
6 

ErrorCode
ASP 0177 : 8007007e 

Description
Server.CreateObject Failed

The DLL is PCMSRV32.DLL in c:\windows

GLOBAL.ASA:

Sub Application_OnStart


set g_pcmsrv=Server.CreateObject("PCMServer.PCMServer")
set application("g_pcmsrv") = g_pcmsrv

set g_pcmmapmgr=Server.CreateObject("Pcmgole.PCMMapMgr")
set application("g_pcmmapmgr") = g_pcmmapmgr


End Sub

Sub Session_OnStart
set Session("currentTrip") = application("g_pcmsrv").NewTrip("NA")
set Session("map") = application("g_pcmmapmgr").createMap()
End Sub

Sub Session_OnEnd
set Session("currentTrip") = Nothing
set Session("map") = Nothing
End Sub

Sub Application_Onend
Set application("g_pcmsrv")=Nothing
Set application("g_pcmmapmgr")=Nothing
End Sub

解决方案

What Causes This error?

Server.CreateObject Failed

is caused most commonly when Web Applications are moved from one Web Server to another without an understanding of external COM components that are in use and registered with the Web server.

From PRB: Server.CreateObject Returns HTTP 500.100 or ASP 0177 Error (0x8007007E)

This error occurs when you attempt to use the Server.CreateObject method to instantiate an object that is not registered on the local system.

Identifying the Source of the Error

If you are using COM components inside a ASP Web application you will see a line like this

set g_pcmsrv=Server.CreateObject("PCMServer.PCMServer") 

Usually the error will point to the Set line which makes identifying the cause easier (luckily you have some nice trace code in place so it's even better).

What If You Don't Know Where the DLL Is Located?

Note: Please be careful when accessing the Windows Registry as it is very easier to inadvertently make changes that have serious consequences for the Operating System and in extreme cases will require a system restore or re-install / repair.

The string inside the CreateObject method is known as a ProgId and is used as an identifier to a key inside the Windows Registry that can be found inside the

Note: Windows Registry can be browsed in most versions of Windows using the regedit.exe also known as the Registry Editor. Be very careful when using this tool to browse the Windows Registry.

HKEY_CLASSES_ROOT

and by extension

HKEY_LOCAL_MACHINE\Classes

Whenever the ASP processor encounters a ProgId it attempts to talk to the Windows Registry and find a corresponding key that denotes the location of the registered COM accessible DLL.

HKEY_CLASSES_ROOT\PCMServer.PCMServer

A common approach to this is the key contains a subkey called CLSID which points to the Class GUID for the associated registered DLL. Once the GUID key is located in the

HKEY_CLASSES_ROOT

hive it can be used to find the location by looking in the subkey

HKEY_CLASSES_ROOT\{GUID from CLSID}\InprocServer32

where the location will be stored in the (default) value.

Example Using the ProgId - Scripting.FileSystemObject

  1. Locate Scripting.FileSystemObject subkey in HKEY_CLASSES_ROOT

    HKEY_CLASSES_ROOT\Scripting.FilesystemObject
    

  2. Identify GUID from subkey CLSID

    HKEY_CLASSES_ROOT\Scripting.FilesystemObject\CLSID
    
    (default) - "{0D43FE01-F093-11CF-8940-00A0C9054228}"  
    

  3. Use GUID to find registered DLL subkey in HKEY_CLASSES_ROOT

    HKEY_CLASSES_ROOT\{0D43FE01-F093-11CF-8940-00A0C9054228}
    

  4. Check subkey InprocServer32 (default) value for the DLL location

    HKEY_CLASSES_ROOT\{0D43FE01-F093-11CF-8940-00A0C9054228}\InprocServer32
    
    (default) - "C:\Windows\System32\scrrun.dll"
    

No ProgId for PCMServer.PCMServer in the Registry?

If you cannot find the corresponding ProgId in the registry it is likely due to one of two reasons we will elaborate on here.

  1. The DLL is not registered.
  2. The DLL is registered in the wrong area.

How to register COM DLL with Windows

COM DLLs can be registered and have the corresponding Registry entries created by running the regsvr32.exe tool from the Windows Command Prompt using elevated permissions (this varies from version to version of Windows).

Before we continue though the architecture of both the Operating System and the mode used by the ASP Web application are very important.

Most newer hardware is 64 Bit this creates a conundrum in Windows as it now has to support newer 64 bit architecture and still maintain support for 32 bit architecture. The solution Microsoft came up with was to split the OS in two, so we have 64 bit elements and 32 bit elements. The main OS programs are broken down into two folders (only on 64 bit OS because a 32 Bit OS doesn't have to contend with 64 Bit, even if the hardware is capable of it).

Note: On 32 Bit only systems just use the 64 Bit locations for both System Files and the Windows Registry.

On a 64 Bit OS the System Programs are located in

  1. For 32 Bit programs

    %SystemRoot%\System32\
    

  2. For 64 Bit programs

    %SystemRoot%\SysWOW64\
    

This is also applies to the Windows Registry

  1. 32 Bit

    HKEY_CLASSES_ROOT
    

  2. 64 Bit

    HKEY_CLASSES_ROOT\Wow6432Node
    

So for example on a 64 Bit version of Windows the following command will register the PCMSRV32.DLL in the 32 Bit Registry and create the associated COM DLL registry keys.

C:\Windows\SysWOW64>regsvr32 "C:\Windows\PCMSRV32.DLL"

IIS Application Pool

As everything begins to support 64 Bit including IIS you still need to be able to support legacy applications that only support 32 Bit COM, so IIS introduced in IIS 6.0 (starting with Windows Server 2003, Service Pack 1) under the Application Pool settings the configurable property Enabled32BitAppOnWin64 which allows the Application Pool to run in 32 Bit mode on 64 Bit versions of Windows.

With this in mind before you register the COM DLL to know where you should be registering it you need to know whether the Application Pool is running in 32 Bit Mode. In IIS 7.0 and above you can just check this from the Application Pool properties inside the IIS Manager application. The setting is in the Advanced Settings under the General section and is called Enable 32-Bit Applications (can also be configured in the applicationHost.config using enable32BitAppOnWin64 under the <ApplicationPools> section).

  • If Enable 32-Bit Applications is set to False

    The IIS application Pool is running in native 64 Bit mode and any COM DLLs that need to be used by the ASP Web Application will need to support 64 Bit and be registered using the 64 Bit version of regsvr32.exe to be added into the 64 Bit registry.

    C:\Windows\System32>regsvr32 "C:\Windows\PCMSRV32.DLL"
    

  • If Enable 32-Bit Applications is set to True

    The IIS Application Pool is running in 32 Bit Mode and any COM DLLs that need to be used by the ASP Web Application will need to be 32 Bit COM DLLs and be registered using the 32 Bit version of regsvr32.exe to be added into the 32 Bit registry.

    C:\Windows\SysWOW64>regsvr32 "C:\Windows\PCMSRV32.DLL"
    

Registering the COM DLL Using the Wrong Version of regsvr32.exe

For example using

C:\Windows\SysWOW64>regsvr32 "C:\Windows\PCMSRV32.DLL"

to register the COM DLL with the 32 Bit registry on a 64 Bit version of Windows when the IIS Application Pool is not in 32 Bit Mode will cause the ASP 500.100 Internal Server error

Server object error 'ASP 0177: 8007007e'

Server.CreateObject Failed


COM DLL Checklist

  1. What is the IIS Application Pool Advanced Setting Enable 32-Bit Applications set to, as it impacts on how you register the COM DLL?

  2. Is the DLL registered using the architecture specific version of regsvr32.exe (if Windows version isn't 64 Bit use the default) that reflects the setting of Enable 32-Bit Applications?

  3. Does the Windows Registry contain a ProgId for the DLL in the architecture specific location of

    HKEY_CLASSES_ROOT
    

    that reflects the setting of Enable 32-Bit Applications?

  4. Does the InprocServer32 key contain the correct location for the DLL?


Useful Links

这篇关于错误ASP 0177:8007007E的Server.CreateObject失败COM DLL的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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