Why is a “bindingRedirect” added to the app.config file after adding the Microsoft.Bcl.Async package?

后端 未结 2 1295
轻奢々
轻奢々 2021-02-11 12:29

I was wondering why nuget added the following code to my applications app.config file, after installing the Microsoft.Bcl.Async:



        
相关标签:
2条回答
  • 2021-02-11 13:09

    You are simply saying whenever there is older version that is between 0.0.0.0 to 2.5.19.0, please replace that version with the new version that is 2.5.19.0

    Let's say you don't have the older version available in your project and you are trying to access it, then you will end up with an error like "System.IO.FileLoadException: 'Could not load file or assembly"

    So when your project is looking for an older version of that DLL it will simply replace that with new one which is available

    0 讨论(0)
  • 2021-02-11 13:10

    The assemblies Microsoft.Threading.Tasks and Microsoft.Threading.Tasks.Extensions are still referencing v1.5.11.0 of System.Runtime and System.Threading.Tasks.

    Without the bindingRedirect, the Microsoft.* assemblies would try to load an old version of the System.* assemblies, which would fail.

    0 讨论(0)
提交回复
热议问题