Server.CreateObject Failed in Classic ASP(Server.CreateObject 在经典 ASP 中失败)
问题描述
我用我需要在经典 ASP 页面中使用的一个功能创建了 ASP.NET dll.
I created the ASP.NET dll with one function that i need to use in Classic ASP page.
我使用下面的代码在经典的 asp 页面中创建对象
I used the below code for creating object in classic asp page
set PeopleSoft = server.createobject("OPS.PSL")
执行时出现以下错误
Server object error 'ASP 0177 : 80070002'
Server.CreateObject Failed
我在 stackoverflow 中搜索了一些解决方案.通过启用使程序集 COM 可见"和注册 COM 互操作".
I searched in stackoverflow i saw some solution. By enabling the "Make assembly COM-visible" and "Register for COM interop".
请帮助我摆脱这个问题
推荐答案
你必须先注册你的DLL,如果问题仍然存在,这样做:
You have to register your DLL first, and if the problem persists, do this:
- 找到并单击以下注册表子项:HKEY_LOCAL_MACHINESOFTWAREMicrosoftInternet ExplorerMAINFeatureControlFEATURE_IGNORE_ZONES_INITIALIZATION_FAILURE_KB945701
- 注意如果 FEATURE_IGNORE_ZONES_INITIALIZATION_FAILURE_KB945701 子项不存在,您必须手动创建它.如果您使用的是 64 位操作系统,则可能需要改用 HKEY_LOCAL_MACHINESOFTWAREWow6432NodeMicrosoftInternet ExplorerMAIN FeatureControlFEATURE_IGNORE_ZONES_INITIALIZATION_FAILURE_KB945701
- 右键单击 FEATURE_IGNORE_ZONES_INITIALIZATION_FAILURE_KB945701,指向新建,然后单击 DWORD 值
- 键入 w3wp.exe 以命名新的注册表项,然后按 Enter.
- 右键单击 w3wp.exe,然后单击修改.
- 在数值数据框中,键入 1,然后单击确定.
设置此注册表项后,简单的应用程序池重启将应用更改.您的 .NET COM 组件将不再会在没有真正解决方案的情况下随机停止工作,除非改组应用程序池!
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!
这篇关于Server.CreateObject 在经典 ASP 中失败的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:Server.CreateObject 在经典 ASP 中失败
基础教程推荐
- 更新 Visual Studio 中的 DataSet 结构以匹配新的 SQL 数据库结构 2022-01-01
- SonarQube C# 分析失败“不是指针的有效行偏移" 2022-01-01
- 在 VB6 或经典 ASP 中使用 .NET 2022-01-01
- 获取C#保存对话框的文件路径 2022-01-01
- 将数据集转换为列表 2022-01-01
- Mono https webrequest 失败并显示“身份验证或解密失败" 2022-01-01
- 如果条件可以为空 2022-01-01
- C# 9 新特性——record的相关总结 2023-04-03
- 重新排序 WPF TabControl 中的选项卡 2022-01-01
- 从 C# 控制相机设备 2022-01-01
