我的C#程序通过Nco3(sapnco.dll)访问SAP。这个程序还需要与Delphi配合使用。我的一些方法返回的类型来自于sapnco.dll:
public void IRfcTable table(...) { ... }
在Delphi中,该方法显示为:
function table(...): IUnknown { ... }
我猜测这个 IUnknown
是因为我的TLB中没有包含sapnco.dll。我在Visual Studio中尝试了"Embed Interop Types = true",但是出现了以下错误:
由于缺少ImportedFromTypeLibAttribute属性或PrimaryInteropAssemblyAttribute属性,无法嵌入程序集“C:\...”中的互操作类型。
(Interop Types could not be embedded because some attributes are missing).
如果这是正确的方法,那么应该把这些属性放在哪里呢?