【发布时间】:2012-02-15 15:26:58
【问题描述】:
您好,我有一个 C Dll,它将与一个 cobol 应用程序交互。我们想通过互联网将数据发送到 cobol。
所以我创建了一个 C# DLL,它将调用 C DLL。当我做一个控制台应用程序时它工作正常,但是当我尝试从 ASP.NET 调用相同的 DLL 时它给出错误消息
我不明白那个错误
An attempt was made to load a program with an incorrect format. (Exception from HRESULT: 0x8007000B)
还有其他一些关于此的帖子,但与我的上下文不符
我想我缺少 permissions 的 asp.net
这是我的 c# dll 中用于调用 c dll 的声明
[DllImport(@"C:\CCExpert\haz450cp.dll", EntryPoint = "Methodname", CallingConvention = CallingConvention.Cdecl)]
unsafe public static extern void Methodname(ref p1, ref p2);
编辑:
您好,我根据您的建议更改了设置,但现在出现新错误
Microsoft Visual Studio C Runtime Library has detected a fatal error in w3wp.exe
【问题讨论】:
-
如果您可以在控制台应用程序中使用上述声明调用此 .dll,则相同的声明在 ASP.NET 中应该可以正常工作。这使您更有可能遇到 IIS 的 32/64 位问题。
标签: c# asp.net web-services dll