Probing the assembly from parent directory of the exe

2k Views Asked by At

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>

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.

2

There are 2 best solutions below

1
Gaz O'Brien On

Firstly I'm pretty sure you have to use forward slashes rather than backslashes.

In addition to that you can chain your ../ lookups as far back up the directory tree you need to go

Example:

this ../ is the Parent Directory and this ../../ is the Grand-Parent directory and so forth...

0
dstj On

Sadly, you cannot...

The MSDN Documentation states that privatePath [...] [s]pecifies subdirectories of the application's base directory that might contain assemblies. [...]