如:以前的APPDIR目錄中:UpdateRoHSDB.exe,Microsoft.Data.ConnectionUI.Dialog.dll,Microsoft.Data.ConnectionUI.dll
其中後面兩個DLL程序集是UpdateRoHSDB.exe程序中必須引用的。當時是把它們同時放在APPDIR目錄中,程序運行正常。
但後來把這兩個DLL程序集放入APPDIR目錄的子文件夾aaa中。運行UpdateRoHSDB.exe程序出現找到FILES錯誤。
在基文件夾APPDIR目錄中添加配置文件。該文件名稱必須是應用程序名稱加上.config擴展名,如:UpdateRoHSDB.exe.config
配置文件內容格式應該是:
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<probing privatePath="AuxFiles/aaa" />
</assemblyBinding>
</runtime>
</configuration>