COM Interop .Net - 执行 asm 方法时出现内存不足/缓冲区溢出错误
这是一个奇怪的现象。很长一段时间以来,我开发的应用程序一直在使用 com interop 在经典 ASP 应用程序中使用 .Net 类型。我今天再次启动这个应用程序来查看一些问题,当访问这些对象之一的方法时,它出现内存不足错误。很好 - 我想,我只需注销该批次,检查注册表中是否有重复的条目(可能是更高版本),确保只有我期望的版本在 GAC 等中,然后重试。运气不好。好的,下一步可以用一个基本的 VB6 应用程序来完成这个任务吗?回答?是的!现在我很困惑。我在 Fusion 日志中没有看到任何与此相关的内容。下面是在 asp 和 VB6 表单中使用以下非常简单的代码来测试这一点:
**VB6**
Private Sub Form_Load()
Dim dsf As MyTypeName
Set dsf = CreateObject("MyNS.MyType")
dsf.MyMethod "SOME TEXT" ' Works fine in VB6
End Sub
**ASP**
Dim dsf
Set dsf = Server.CreateObject("MyNS.MyType")
dsf.MyMethod "SOME TEXT" ' Doesn't work in asp...
确切的错误:
Microsoft VBScript 运行时 (0x800A0007) 内存不足:“MyMethod”
大家有什么想法吗?
This is a strange one. For a long time now an application I develop on has been using com interop to use .Net types in an Classic ASP application. I fired this application up again today to look at some issue with it got an Out Of Memory error when accessing a method on one of these objects. Fine - I thought, I'll just unregister the lot, check for duplicate entries (for later versions perhaps) in the registry, ensure only the version I am expecting is in the GAC etc etc and try again. No luck. Ok, next step can a basic VB6 app do this task; answer? yes! Now I'm confused. I see nothing in the Fusion logs about this. Here is the following very simple code used in both the asp and the VB6 form to test this:
**VB6**
Private Sub Form_Load()
Dim dsf As MyTypeName
Set dsf = CreateObject("MyNS.MyType")
dsf.MyMethod "SOME TEXT" ' Works fine in VB6
End Sub
**ASP**
Dim dsf
Set dsf = Server.CreateObject("MyNS.MyType")
dsf.MyMethod "SOME TEXT" ' Doesn't work in asp...
The exact error:
Microsoft VBScript runtime (0x800A0007)
Out of memory: 'MyMethod'
Any ideas guys?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您的
MyMethod
是否访问大量数据(可能是数组)?我确实从 aspfan - Why-do-i-get-errors-in-the-800a0001-800a000f
搜索您的错误代码。
Does your
MyMethod
access large amounts of data (maybe an array)?I did find this from aspfan - why-do-i-get-errors-in-the-800a0001-800a000f
Search for your error code.