我的文件夹结构为 IntegrationClient\SampleClient\Client.Exe。我创建了一个包含许多第三方程序集的文件夹 DrawingClient。为了让 client.exe 在运行时找到程序集,我使用了如下探测路径并且它有效。
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<probing privatePath="bin;DrawingClient;"/>
</assemblyBinding>
但是如果我需要 client.exe 从父目录中找到 DrawingClient 文件夹,即在 IntegrationClient\DrawingClient 下,我可以通过任何方式实现吗?我尝试使用 ..\DrawingClient 但是失败了。
最佳答案
遗憾的是,你不能...
MSDN Documentation声明 privatePath
[...] [s]指定可能包含程序集的应用程序基目录的子目录。 [...]
关于c# - 从 exe 的父目录探测程序集,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31556078/