EF Core Cosmos 3.0.0 incompatible with .NET Core

asp.net-core azure-cosmosdb entity-framework-core

Question

In an ASP.NET Core (v 2.1.1) web app I'd like to use EF Core with Cosmos DB. For this I need to add the Microsoft.EntityFrameworkCore.Cosmos package.

I'm able to install the old 2.2.0-preview3-35497 NuGet.

However the current 3.0.0-preview8.19405.11 NuGet complains that

NU1202
Package Microsoft.EntityFrameworkCore.Cosmos 3.0.0-preview8.19405.11 
is not compatible with netcoreapp2.1 (.NETCoreApp,Version=v2.1).
Package Microsoft.EntityFrameworkCore.Cosmos 3.0.0-preview8.19405.11
supports: netstandard2.1 (.NETStandard,Version=v2.1)

To me the error sounds like this EF Core provider suppors only .NET and not .NET Core in the latest version.

Which is completely unexpected for an EF Core provider.

Do I understand the error correctly, why such strange change in the new version and how to fix it?

1
2
8/29/2019 1:37:11 PM

Popular Answer

This error is because .Net Core 3.0 look to .net standard 2.1 (not disponible officially). But, Visual Studio is already compatible.

Open your .csproj and edit TargetFramework tag to "netstandard2.1": <TargetFramework>netstandard2.1</TargetFramework>

Make it to all projects and probably works ;p

2
12/14/2019 12:11:13 PM


Related Questions





Related

Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow
Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow