我们的软件是用 C# 编写的,需要连接到 SAP。由于我们的一些客户使用旧版本的 SAP,而其他客户没有 SAP PI,因此我们无法通过 Web 服务进行连接。
我尝试通过 SAP NetWeaver 远程函数调用库 (sapnwrfc.dll) 连接到 SAP,如下所示:
运行此代码会出现 DllNotFoundException:
Unable to load DLL 'sapnwrfc.dll': This application has failed to start because the application configuration is不正确。重新安装应用程序可能会解决此问题。(来自 HRESULT 的异常:0x800736B1)
运行标准的 connect-to-C++-from-C# 示例
[DllImport("user32.dll", CharSet = CharSet.Unicode)]
public static extern int MessageBox(IntPtr hWnd, String text, String caption, uint type);
MessageBox(new …