I found myself encountered this issue lately when trying to upgrade my bootstrap project for Clean lean Architecture via TDD approach (GitHub link here).
What was the issue ?
- When adding Microsoft.EntityFrameworkCore via NuGet in VS2018, the default version is 2.2.0 as following
![](https://dotnetsharing.wordpress.com/wp-content/uploads/2018/12/image.png)
- The default webapi created from VS2018 or dotnet core cmd uses Microsot.AspNetCore.App version 2.1.1 which is compatible with entity framework version 2.1.x and below.
![](https://dotnetsharing.wordpress.com/wp-content/uploads/2018/12/image1.png)
How did I resolve it?
Approach 1: manually update the infrastructure project to use Microsoft.EntityFramework version 2.1.0
- To do this, we have to manually override the version in the project property file.
- Then run dotnet restore from cmd to update the library to expected version
![](https://dotnetsharing.wordpress.com/wp-content/uploads/2018/12/image2.png)
Approach 2: Upgrade the default library of api project to latest version which is compatible with Microsoft.EntityFramework version 2.2.0
- Remove Microsoft.AspNetCore v2.1.0
- Add from Nuget the latest version of 2.2.0 for both AspNetCore and AspNetCore.Mvc
![](https://dotnetsharing.wordpress.com/wp-content/uploads/2018/12/image3.png)
Approach 3: Update DotNet Core to v2.2.0 which should be the easiest approach I would recommend to undertake.
- Make sure that you have it updated with latest version of VS2018 as well.
Hope it helps to avoid some wasted time.
Until we meet again, happy coding.