Search code examples
c#asp.net-core.net-corenugetnpgsql

What to do if MSB3277 occurs in asp net core app


I am using a Database-Project referencing EntityFrameworkCore 2.1.3 package but the AspNetCore.App-metapackage contains EntityFrameworkCore 2.1.2. After bringing in my Database-Project I get this msbuild-warning:

Warning MSB3277 Found conflicts between different versions of "Microsoft.EntityFrameworkCore" that could not be resolved.

I´ve googled around a bit an I found this doc: https://learn.microsoft.com/en-us/aspnet/core/fundamentals/metapackage-app?view=aspnetcore-2.1

I´m using a third-party library (NpgSql for Postgre) which relies on 2.1.3... Should I downgrade all packages, so that they use efcore 2.1.2 package or should I ignore this warning? Or better question: Which way is less painful?

Thanks in advance


Solution

  • It's true that Npgsql.EntityFrameworkCore.PostgreSQL is currently at version 2.1.2, and depends on Microsoft.EntityFrameworkCore 2.1.2. However, there shouldn't be any issue with using an older version of the Npgsql EF Core provider with newer patch versions of EF Core itself.

    You can probably get rid of this warning by taking a direct dependency on Microsoft.EntityFrameworkCore 2.1.3 in your own project.