从 exe 的父目录探测程序集 [英] Probing the assembly from parent directory of the exe

查看:22
本文介绍了从 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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆