probing privatePath and subdirectories
Asked Answered
S

1

13

In my application I would like to put DLL files in a subdirectory. I'm using the probing element in app.config and it works quite fine, but I've got an issue with localization assemblies.

<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
    <probing privatePath="libs"/>
</assemblyBinding>

If I have two DLLs in:

libs/de/myAssembly.dll

and

libs/myAssembly.dll

The first one is loaded, while I want that the file in the root folder is preferred. How can I achieve this?

Sweetheart answered 21/2, 2014 at 10:12 Comment(1)
I discovered that the problem was related only to resources' dll and to the way I was implementing the AssemblyResolve event handler. Now I test the cultureInfo before I load the assembly.Sweetheart
N
15

You can set multiple paths to probe.

<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
    <probing privatePath="libs;libs/de;libs/fr"/>
</assemblyBinding>

Please see official microsoft documentation on probing element

Nakisha answered 21/2, 2014 at 13:52 Comment(2)
Read the comment to my own question. Thank you.Sweetheart
Just a random programmer passing by saying thank you for your solution ^_^Deferential

© 2022 - 2025 — McMap. All rights reserved.