简体   繁体   English

如何在Visual Studio 2017解决方案中设置文件夹以在其中搜索DLL?

[英]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.

相关问题 Visual Studio 2017-发行文件夹中可能不需要的dll - Visual Studio 2017 - Potentially unneeded dlls in release folder Visual Studio 2017 找不到解决方案中存在的文件夹 - Visual Studio 2017 can't find folder that exists in the solution 无法识别解决方案文件夹中的Visual Studio 2017 Nuget.config - Visual Studio 2017 Nuget.config at solution folder not recognized 在 Visual Studio 中编译时如何将 DLL 保存在不同的文件夹中? - How to save DLLs in a different folder when compiling in Visual Studio? 解决方案中的Visual Studio 2017可扩展性项目计数 - Visual Studio 2017 Extensibility Project count in Solution Visual Studio升级到2017 15.5.3打破了解决方案 - Visual Studio upgrade to 2017 15.5.3 breaks solution 为什么Visual Studio 2017会发布整个解决方案? - Why Visual studio 2017 is publishing entire solution? 如何在Visual Studio中设置解决方案的引用路径? - How to set the reference path for the solution in Visual Studio? Visual Studio 2017 解决方案中丢失的引用 - Lost references in Visual Studio 2017 solution 解决方案资源管理器中的 Visual Studio 2017 锁定文件 - Visual Studio 2017 lock file in solution explorer
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM