Error Could not load file or assembly ‘Microsoft.Extensions.DependencyInjection, Version=1.0.0.0

Abhishek Malaviya
1 min readOct 7, 2019

There’s an issue with auto-generated binding redirects . To work around it, add below setting in your cpsroj file (preferably before any <Import> element for a .targets file if present):

<PropertyGroup>
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
<GenerateBindingRedirectsOutputType>true</GenerateBindingRedirectsOutputType>
</PropertyGroup>

This should force MSBuild to create / update a YourProject.dll.config file containing the necessary binding redirects.

--

--

Abhishek Malaviya

AI, Cloud, DevOps, Microservice, .NET, Sitecore, JavaScript, Database