探究privatePath和子目录

问题描述:

在我的应用程序中,我想将DLL文件放在一个子目录中.我在app.config中使用了probing元素,它工作得很好,但是本地化程序集存在问题.

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>

如果我有两个DLL:

libs/de/myAssembly.dll

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?

您可以设置多个探测路径.

You can set multiple paths to probe.

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

请参见探测元素的正式Microsoft文档.