Adding C++ DLL's to a C# project

前端 未结 4 1575
误落风尘
误落风尘 2021-02-13 20:58

I\'m trying to use the lame_enc.dll file from LAME in a C# project, but adding the thing seems impossible.

I keep getting an error that says that a reference could not b

4条回答
  •  Happy的楠姐
    2021-02-13 21:41

    You can only add managed assemblies as a reference to a managed project. What I normally do in this situation is to add it as ressource instead with "copy local" settings. That way the DLL is tied to and deployed with your project. I then use DllImport to manually get the APIs I need from that DLL.

提交回复
热议问题