Could not load file or assembly Microsoft.Extensions.DependencyInjection.Abstractions, Version1.1.0.0
Object-Oriented Design practice on Codemia
Turn requirements into classes, and defend the design, on the problems that come up in OOD rounds.
When developing applications in .NET, particularly with ASP.NET Core or other .NET Core applications, you might encounter the error: "Could not load file or assembly 'Microsoft.Extensions.DependencyInjection.Abstractions, Version=1.1.0.0'." This error can be perplexing and potentially halt the development process, so understanding its cause and how to resolve it is crucial for smooth development operations.
Understanding the Error
What It Represents
The error indicates that the .NET application is trying to load a specific version (1.1.0.0) of the Microsoft.Extensions.DependencyInjection.Abstractions
assembly, but it is either missing or a different version is available. Assemblies in .NET are versioned to ensure compatibility and control dependencies. When the required version is not present, the runtime throws this error.
Why It Happens
Several scenarios can lead to this error:
- Mismatch of Package Version: The project may be referencing different versions of the package due to mixed NuGet package versions across various projects in your solution.
- Missing Assembly: The required DLL may not be present in the output directory or package cache.
- Configuration Errors: Incorrectly set up project files (such as
.csprojorapp.config) orbindingRedirectsettings in theweb.configmay lead to this issue. - Project Migrations: Moving from older versions of .NET Core to newer versions might result in package inconsistencies.
Solutions
1. Update Package References
Ensure that all projects in the solution are consistently referencing the same package version. Use the .NET Core CLI or modify the .csproj
file to update:
- Consistent Package Management: Utilize tools such as
Directory.Packages.propsfor centralized version management in multi-project solutions. - Regular Updates: Keep your packages updated with the latest versions to prevent incompatibility and enjoy performance improvements and security patches.
- Automated Builds: Employ automated build systems (e.g., CI/CD pipelines) to ensure that builds are consistent and assemblies are correctly bundled.
- Assembly Versioning Awareness: Familiarize yourself with how .NET handles assembly versioning to predict and handle potential issues proactively.
Related reading
- Create a new instance of component in Spring Boot/Framework
- Create instance of generic type whose constructor requires a parameter?
- C's equivalent of Java's ? extends Base in generics
- Design pattern for checking asynchronous task dependencies before execution
- Could not load file or assembly Operation is not supported. Exception from HRESULT 0x80131515
- Could not load file or assembly or one of its dependencies
- Design pattern to limit access to a shared resource
- Design Patterns Factory vs Factory method vs Abstract Factory

OOD Fundamentals
Master object-oriented design from first principles, SOLID, design patterns, and classic interview problems with hands-on coding.
View the courseTrack what you have practised
A free account saves your progress, solutions and study plan across every problem on Codemia.
Object-Oriented Design practice on Codemia
Turn requirements into classes, and defend the design, on the problems that come up in OOD rounds.