【发布时间】:2016-06-24 05:56:00
【问题描述】:
我在我的 MVC 4 应用程序中使用了一个使用 vfp6 创建的 COM DLL(类型库),用于对 FoxPro DB 数据表进行数据操作。我可以使用 Regsvr32 成功注册 dll,也可以在我的项目中进行引用。
在我的 Web 应用程序中,我可以为 COM dll 类创建一个对象,但无法访问其属性或方法。我得到了iisexpress.exe has exited with code -1073741819 (0xc0000005) 访问冲突error when run the project from visual studio(admin mode) with debug. If i run the project without debug i got "System.Runtime.InteropServices.COMException: The server threw an exception. (Exception from HRESULT: 0x80010105 (RPC_E_SERVERFAULT)) 异常。
Dim objCOM = new foxprocom() // this creats the instance without any issue
objCOM.Path = "my path" -- this line throws the errors
之前我使用了使用 vfp9 创建的 COM dll,它工作正常,但使用 vfp6 的这个版本不工作。 vfp6 COM dll 是否与 .net 4.5 兼容?
请帮我解决这个问题。
【问题讨论】:
-
可能是 32 位问题?确保您的目标平台是 x86。 OTOH 出现 C0000005 错误的原因有很多,其中大部分已在 VFP9 之前得到纠正。我假设您已经导入了 typelib。您是否也测试过,如果该 DLL 可以成功地与 VB6 或 JScript 一起使用?
标签: .net visual-foxpro