ASP.NET unmanaged dll调用在实时服务器上失败,在本地工作 - 重新发布

时间:2013-06-20 15:19:08

标签: asp.net

我正在转发这个。我遇到的问题是,当我通过Visual Studio 2010运行时,我的代码在本地开发服务器上运行,但是当我上传到我们的主机时,它在其中一个dll调用中失败。 我的相关代码有点像:

IntPtr thingDB = loadDBThing("pathToDB")
If thingDB = 0 then <- check to see if pointer was returned
   display getLastErrorMessage() 
   EXIT SUB
END IF
...
IntPtr thing = createThing(thingDB)
If thing = 0 then
   display getLastErrorMessage() 
   EXIT SUB
END IF
...
IntPtr resultThing = doThing(thing)  <- Code fails here
If resultThing = 0 then
   display getLastErrorMessage() 
   EXIT SUB
END IF
...
IntPtr anotherResultThing = doOtherThing(resultThing) 

似乎doThing()在实时服务器上抛出错误,但在本地服务器上一切正常。我使用的图书馆是第三方图书馆,没有任何支持。服务器没有抛出错误,但我能够检查指针的返回值并从库中获取最后一条错误消息,虽然我得到的错误字符串('未知异常')不是很有帮助。我检查了所有结果变量的指针值,doThing()返回零值。如果我更改resultThing并将doThing()的返回值更改为Int64我实际上会返回指针,但doOtherThing()将不接受resultThing我可以不能将其转换回Int32IntPtr

想知道是否有人可以帮助解释为什么会发生这种情况?

操作系统:Microsoft Windows NT 5.2.3790 Service Pack 2 微软IIS / 6.0 ASP.NET版本:2.0.50727.3643
平台字符串:Win32NT

0 个答案:

没有答案
相关问题