从 exe 的父目录探测程序集 [英] Probing the assembly from parent directory of the exe
问题描述
我的文件夹结构为 IntegrationClient\SampleClient\Client.Exe.我创建了一个包含许多第三方程序集的文件夹 DrawingClient.为了使 client.exe 在运行时查找程序集,我使用了如下探测路径并且它可以工作.
i have a folder structure as IntegrationClient\SampleClient\Client.Exe. I have created a folder DrawingClient with lot of thirdparty assemblies. For client.exe to find the assembly at runtime , i have used probing path as below and it works.
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<probing privatePath="bin;DrawingClient;"/>
</assemblyBinding>
但是如果我需要 client.exe 从父目录(即 IntegrationClient\DrawingClient 下)找到 DrawingClient 文件夹,我可以通过任何方式实现吗?我尝试使用 ..\DrawingClient 但是失败了.
But if i need the client.exe to find the DrawingClient folder from parent directory ie under IntegrationClient\DrawingClient, can i achieve that by any means ? I tried using ..\DrawingClient however that failed.
推荐答案
遗憾的是,您不能...
Sadly, you cannot...
MSDN 文档 指出privatePath
[...] [s]指定可能包含程序集的应用程序基目录的子目录.[...]
The MSDN Documentation states that privatePath
[...] [s]pecifies subdirectories of the application's base directory that might contain assemblies. [...]
这篇关于从 exe 的父目录探测程序集的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!