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

查看:127
本文介绍了如何解决“请确保该文件可访问并且它是有效的程序集或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天全站免登陆