如何解决“请确保该文件可访问并且它是有效的程序集或 COM 组件"? [英] How do I resolve "Please make sure that the file is accessible and that it is a valid assembly or COM component"?

查看:31
本文介绍了如何解决“请确保该文件可访问并且它是有效的程序集或 COM 组件"?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在用 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屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆