Could not load file or assembly xxx or one of its dependencies

We hit the fairly common issue of not being able to resolve a dependency the other day and tried all the usual resolutions -checking that the version numbers across all projects match, check the values in the configs haven't corrupted during an install, clean and rebuild the solution, updated/reinstalled the nuget packages and nothing worked, we just kept hitting ``` Could not load file or assembly 'Autofac, Version=3.5.0.0, Culture=neutral, PublicKeyToken=17863af14b0044da' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040) ``` The fix was ridiculously simple, in short, one of the app.configs had some out of date dependencies in the redirects -in this instance pointing at a newer version of Autofac from a failed upgrade so the fix was simply to correct the mappings. I didn't know that the app.config would affect the compiled assembly but it must overwrite the referenced DLL as the referenced versions were correct So in summary, the references were changed from: ``` ``` To this: ``` ```

Subscribe to TSD

Don’t miss out on the latest posts. Sign up now to get access to the library of members-only posts.
jamie@example.com
Subscribe