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

后端 未结 7 1882
北荒
北荒 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:36

    In my case I also have unmanaged dll's (C++) in workspace and if you specify:

    
        
    
    

    nuget would try to load every dll as an assembly, even the C++ libraries! To avoid this behaviour explicitly define your C# assemblies with references tag:

    
        
        
    
    

    Remark: parent of references is metadata -> according to documentation https://docs.microsoft.com/en-us/nuget/reference/nuspec#general-form-and-schema

    Documentation: https://docs.microsoft.com/en-us/nuget/reference/nuspec

提交回复
热议问题