This question was triggered by another issue I was just dealing with. There is a managed library, MyAssembly.dll
, targeting .NET 4.0. It has its own MyAssembly.dll.config
file with some <bindingRedirect>
instructions. I believe the .config
file was generated by either compliler or NuGet package manager, as I did not create it manually.
The thing is, the binding instructions are ignored when the DLL gets loaded by a client app (RegAsm.exe
in my case, but I also verified this with a simple console .NET app). I had to move them from the DLL's .config file into the client EXE app's .config file, to be picked up by .NET runtime and get correctly resolved.
The question: what is the purpose of a .config file for a managed library assembly (.DLL), at all? Does it anyhow participate in the process of loading of the library assembly?