Cannot instanciate .Net COM object in classic ASP/VBScript page (Error ASP 0177)

不打扰是莪最后的温柔 提交于 2019-12-02 02:23:59

问题


I've written a COM interop enabled class-library in C# using .Net 3.5. The object is meant to provide some utility functions for classic ASP pages. I've written a test.asp page which instanciates the desired object and calls its methods. Works fine on my machine.

On a different machine (Windows Server 2003 - Standard Edition) it doesn't work eventhough the assembly is registered with regasm correctly. I've checked the regedit and afaik it looks ok.

The error I'm getting is "ASP 0177" (error code), "8000ffff; Server.CreateObject-Fehler" (error description) which translates to Server.CreateObject-Error.

Btw. the assembly is signed and doesn't have any other custom build assemblies as dependencies (just the system stuff).

Did anyone experience something similar?


回答1:


Granting the IUSR user (or whoever your IIS user is) read-access to the following Registry Key did the job for me and fixed the Problem.

HKEY_USERS\S-1-5-20\Software\Microsoft\Windows\CurrentVersion\Internet Settings\Zones



回答2:


I think it's a security issue. It seems you had developed and tested the component in your own pc, which have a lot of differences compared to a server (having visual studio installed by example).


EDIT: Please take a look at this Microsoft "Hotfixes a hotfix":

  • Error message when you browse a Web server that has Internet Explorer 7 installed: "ASP 0177:8000ffff"
  • KB937143 breaks ASP to .NET COM interop



回答3:


  • Locate and then click the following registry subkey: HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Internet Explorer\MAIN\ FeatureControl\FEATURE_IGNORE_ZONES_INITIALIZATION_FAILURE_KB945701
  • Note If the FEATURE_IGNORE_ZONES_INITIALIZATION_FAILURE_KB945701 subkey does not exist, you must manually create it. If you're using a 64 bit OS, you may need to use HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Internet Explorer\MAIN\ FeatureControl\FEATURE_IGNORE_ZONES_INITIALIZATION_FAILURE_KB945701 instead
  • Right-click FEATURE_IGNORE_ZONES_INITIALIZATION_FAILURE_KB945701, point to New, and then click DWORD Value
  • Type w3wp.exe to name the new registry entry, and then press ENTER.
  • Right-click w3wp.exe, and then click Modify.
  • In the Value data box, type 1, and then click OK.

After setting this registry key, a simple app pool restart will apply the change. No longer will your .NET COM components randomly stop working with no real solution except shuffling application pools!



来源:https://stackoverflow.com/questions/1518986/cannot-instanciate-net-com-object-in-classic-asp-vbscript-page-error-asp-0177

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!