[英]How to set folder in a visual studio 2017 solution for searching DLLs there?
I would like to use openCV with EmguCV, but I dont want to add openCV dlls as a reference, and I also don't want to copy all openCV dlls to bin folder. 我想将openCV与EmguCV一起使用,但我不想添加openCV dll作为参考,并且我也不想将所有openCV dll复制到bin文件夹。 How can I give a folder to my project to let it know that the required dlls are there?
如何为我的项目提供一个文件夹,以使它知道所需的dll是否存在?
I think THIS is something you are looking for, you should follow the (well explained) steps of the Author and you should be fine. 我认为这是您正在寻找的东西,您应该遵循作者的(充分解释)的步骤,并且应该没问题。
This will read your added embedded resource (dll in your case) and Load/compile it at runtime by its location (and other logic). 这将读取您添加的嵌入式资源(在您的情况下为dll),并在运行时按其位置(和其他逻辑)加载/编译该资源。
Quote: 引用:
The DLLs are not distributed with the application, when the application fails to locate the DLL, it raises an Event of AppDomain.CurrentDomain.AssemblyResolve.
DLL不随应用程序一起分发,当应用程序无法找到DLL时,它将引发AppDomain.CurrentDomain.AssemblyResolve事件。 AssemblyResolve is requesting the missing DLL.
AssemblyResolve正在请求丢失的DLL。 Then, we will tell our application to look for the DLL in memory.
然后,我们将告诉我们的应用程序在内存中查找DLL。 Use EmbeddedAssembly.Get to retrieve the DLL from memory and pass it for AssemblyResolve to handle the rest.
使用EmbeddedAssembly.Get从内存中检索DLL,并将其传递给AssemblyResolve处理其余部分。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.