如何解决“请确保该文件可访问并且它是有效的程序集或 COM 组件"? [英] How do I resolve "Please make sure that the file is accessible and that it is a valid assembly or COM component"?
问题描述
我正在用 C# 中的 OpenCV 构建一个项目.它需要一个名为 cvextern.dll
的 dll 文件.但是,当将此文件添加为参考时,会出现此消息:-
I am building a project with OpenCV in C#. It requires a dll file called cvextern.dll
. but, when adding this file as a reference, this message appears :-
无法添加引用cvextern.dll",请确保该文件可访问并且它是有效的程序集或 COM 组件.
搜索累了,这两天我一直在寻找解决这个问题的方法
I get tired from searching, I spent the past 2 days in searching for a solution for that problem
推荐答案
该文件是本机 DLL,这意味着您无法通过添加引用将其添加到 .NET 项目...您可以通过 DllImport 使用它(请参阅http://msdn.microsoft.com/en-us/library/system.runtime.interopservices.dllimportattribute.aspx)
the file is a native DLL which means you can't add it to a .NET project via Add Reference... you can use it via DllImport (see http://msdn.microsoft.com/en-us/library/system.runtime.interopservices.dllimportattribute.aspx)
这篇关于如何解决“请确保该文件可访问并且它是有效的程序集或 COM 组件"?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!