在C#控制台应用程序中,我正在尝试使用 <probing privatePath=""/>
指向不在我的应用程序子目录中的dll。我在用着:
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<probing privatePath="D:\Library\References" />
</assemblyBinding>
</runtime>
这不起作用,因为privatePath正在我的应用程序中查找子目录。有没有办法以这种方式使用绝对路径?如果没有,指向位于我的应用程序之外的dll的最佳方法是什么?我也试过用 <codebase>
用一个 file:///
路径,但仍然有一个 System.IO.FileNotFound
例外。
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity
name="MyLibrary" publicKeyToken="29989D7A39ACF230" />
<codeBase
version="2.0.0.0"
href="http://file:///D:/Library/References/NLog.dll"/>
</dependentAssembly>
</assemblyBinding>
</runtime>
但仍然有一个 System.IO.FileNotFound
例外。
谢谢!