How do I resolve “Please make sure that the file is accessible and that it is a valid assembly or COM component”?

后端 未结 7 1854
北荒
北荒 2020-11-27 16:17

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 :-

<
7条回答
  •  时光取名叫无心
    2020-11-27 16:33

    'It' requires a dll file called cvextern.dll . 'It' can be either your own cs file or some other third party dll which you are using in your project.

    To call native dlls to your own cs file, copy the dll into your project's root\lib directory and add it as an existing item. (Add -Existing item) and use Dllimport with correct location.

    For third party , copy the native library to the folder where the third party library resides and add it as an existing item.

    After building make sure that the required dlls are appearing in Build folder. In some cases it may not appear or get replaced in Build folder. Delete the Build folder manually and build again.

提交回复
热议问题