我正在使用 C# 中的 OpenCV 构建一个项目。它需要一个名为 cvextern.dll
的 dll 文件。但是,当添加此文件作为引用时,会出现此消息:-
无法添加引用“cvextern.dll”,请确保该文件可访问并且它是有效的程序集或 COM 组件。
我搜索累了,过去两天我一直在寻找该问题的解决方案
最佳答案
该文件是 native DLL,这意味着您无法通过添加引用将其添加到 .NET 项目中...您可以通过 DllImport 使用它(参见 http://msdn.microsoft.com/en-us/library/system.runtime.interopservices.dllimportattribute.aspx)
关于c# - 我如何解决 "Please make sure that the file is accessible and that it is a valid assembly or COM component"?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7080447/