替换运行时动态查找程序集的位置
我们有一个应用程序,下面有一些“Utils”(一些简单的程序)。
这些实用程序依赖于我们的应用程序也在使用的一些共享 DLL,因此,我们只想将这些 DLL 分发一次(放置在 APP_BASE\bin 下)。
我们正在寻找一种解决方案,其中 utils(位于 APP_BASE\Utils 下)将能够在 bin 文件夹(与其基本目录下不相关)中查找。
我知道 .NET 标准配置文件允许这样做,仅适用于相对路径下的程序集。
还有其他选择吗? 我们的 DLL 未签名,也不置于 GAC 之下。
We have an application that has some "Utils" under it (a few simple programs).
These utils are relying on a few shared DLLs that our application is also using, and so, we would like to distribute these DLLs only once (placed under APP_BASE\bin).
We're looking for a solution, where the utils (placed under APP_BASE\Utils) will be able to lookup in the bin folder (which is NOT RELATIVE under its base dir).
I know that the .NET standard config file allows doing so, only for assemblies that are under relative paths.
Is there any other option for doing so?
Our DLLs are not signed and are not placed under the GAC.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以使用 AssemblyResolve 事件。
我们使用此事件来加载 x86\x64 dll,具体取决于用户的平台。
FIY 作为解决方法,您也可以使用 .net developmentMode
You can use AssemblyResolve event.
We are using this event for loading x86\x64 dlls depending of User's platform.
FIY as a workaround you can also use .net developmentMode