在C#控制台应用程序中,我试图<probing privatePath=""/>用来指向不在我的应用程序子目录中的dll.我正在使用:
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<probing privatePath="D:\Library\References" />
</assemblyBinding>
</runtime>
Run Code Online (Sandbox Code Playgroud)
这不起作用,因为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>
Run Code Online (Sandbox Code Playgroud)
但仍有System.IO.FileNotFound例外.
谢谢!