我有一些 nugets 依賴問題。這個異常是拋出Impossible to load the file or assembly 'System.IO.Abstractions, Version=2.1.0.199, Culture=neutral, PublicKeyToken=96bf224d23c43e59'File not found我的項目需要噸包A和B. A要求System.IO.Abstractions>=2.1.0.199和B要求System.IO.Abstractions>=2.1.0.208。所以依賴求解器下載版本208并添加bindingRedirect到我的app.config我的app.config:<?xml version="1.0" encoding="utf-8"?><configuration> <runtime> <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1"> <dependentAssembly> <assemblyIdentity name="System.IO.Abstractions" publicKeyToken="96bf224d23c43e59" culture="neutral" /> <bindingRedirect oldVersion="0.0.0.0-2.1.0.208" newVersion="2.1.0.208" /> </dependentAssembly> </assemblyBinding> </runtime></configuration>但bindingRedirect似乎不起作用。那么你對此有什么想法嗎?在此先感謝您的幫助
1 回答

弒天下
TA貢獻1818條經驗 獲得超8個贊
好的,我找到了解決方案。我的情況是 C# ddl 是 C++ 軟件的插件(因此動態(tài)加載) 配置應命名為軟件名稱 (softwarename.exe.config) 并放在可執(zhí)行文件旁邊。不在工作目錄中,也不在 dll 中。當同時部署多個插件時,這可能會造成麻煩。非常感謝@HansPassant 的幫助。
- 1 回答
- 0 關注
- 170 瀏覽
添加回答
舉報
0/150
提交
取消