You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Both preview 6 and preview 5 of the Azure Cosmos DB provider do not support any Microsoft.Azure.Cosmos.Client version after 3.0.0.1-preview. I assume earlier previews have the same problem, but I did not test them.
For example, calls to the context's Database.EnsureCreated() or SaveChanges() fail with the following message:
System.TypeLoadException: 'Could not load type 'Microsoft.Azure.Cosmos.CosmosDatabaseResponse' from assembly 'Microsoft.Azure.Cosmos.Client, Version=3.0.0.19, Culture=neutral, PublicKeyToken=31bf3856ad364e35'.'
Here is the stack trace from a call to SaveChanges():
at Microsoft.EntityFrameworkCore.Cosmos.Storage.Internal.CosmosClientWrapper.CreateItemOnceAsync(DbContext _, ValueTuple`2 parameters, CancellationToken cancellationToken)
at Microsoft.EntityFrameworkCore.Cosmos.Storage.Internal.CosmosClientWrapper.CreateItemOnce(DbContext context, ValueTuple`2 parameters)
at Microsoft.EntityFrameworkCore.Storage.ExecutionStrategy.ExecuteImplementation[TState,TResult](Func`3 operation, Func`3 verifySucceeded, TState state)
at Microsoft.EntityFrameworkCore.Storage.ExecutionStrategy.Execute[TState,TResult](TState state, Func`3 operation, Func`3 verifySucceeded)
at Microsoft.EntityFrameworkCore.Cosmos.Storage.Internal.CosmosClientWrapper.CreateItem(String containerId, JToken document)
at Microsoft.EntityFrameworkCore.Cosmos.Storage.Internal.CosmosDatabaseWrapper.Save(IUpdateEntry entry)
at Microsoft.EntityFrameworkCore.Cosmos.Storage.Internal.CosmosDatabaseWrapper.SaveChanges(IList`1 entries)
at Microsoft.EntityFrameworkCore.ChangeTracking.Internal.StateManager.SaveChanges(IList`1 entriesToSave)
at Microsoft.EntityFrameworkCore.ChangeTracking.Internal.StateManager.SaveChanges(Boolean acceptAllChangesOnSuccess)
at Microsoft.EntityFrameworkCore.DbContext.SaveChanges(Boolean acceptAllChangesOnSuccess)
at Microsoft.EntityFrameworkCore.DbContext.SaveChanges()
at [REDACTED]
at Microsoft.Extensions.Internal.ObjectMethodExecutor.Execute(Object target, Object[] parameters)
at Microsoft.AspNetCore.Mvc.Infrastructure.ActionMethodExecutor.SyncActionResultExecutor.Execute(IActionResultTypeMapper mapper, ObjectMethodExecutor executor, Object controller, Object[] arguments)
at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.InvokeActionMethodAsync()
at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted)
at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.InvokeNextActionFilterAsync()
The error message changes based on the version of the Microsoft.Azure.Cosmos library you have installed. If you install version 3.0.0.1-preview (November 30, 2018) of the library, the calls succeed and work as intended.
The dependencies of Microsoft.EntityFrameworkCore.Cosmos show Microsoft.Azure.Cosmos >= 3.0.0.1-preview. This should probably be "=" not ">=" if lack of support for the new versions of the 3.0 Cosmos client is intentional.
Steps to reproduce
Install the latest (or any version after 3.0.0.1) Microsoft.Azure.Cosmos from NuGet. Install Microsoft.EntityFrameworkCore.Cosmos preview 5 or 6.
Try to create a model object and add it to the database. Upon calling SaveChanges() on the context, the exception indicated above will be thrown.
Further technical details
EF Core version: 3.0.0-preview5.19227.1
Database Provider: Microsoft.EntityFrameworkCore.Cosmos
Operating system: Windows 10
IDE: Visual Studio 2019 Preview 3
The text was updated successfully, but these errors were encountered:
@rennr This is because EF Core 3.0 is a preview and the Cosmos API is also in preview, and so as a point-in-time thing these two particular versions of the previews do not work together. For now, you'll need to use the same version that EF builds against. This should not be a problem when both are out of preview.
Both preview 6 and preview 5 of the Azure Cosmos DB provider do not support any
Microsoft.Azure.Cosmos.Client
version after3.0.0.1-preview
. I assume earlier previews have the same problem, but I did not test them.For example, calls to the context's
Database.EnsureCreated()
orSaveChanges()
fail with the following message:Here is the stack trace from a call to
SaveChanges()
:The error message changes based on the version of the
Microsoft.Azure.Cosmos
library you have installed. If you install version3.0.0.1-preview
(November 30, 2018) of the library, the calls succeed and work as intended.The dependencies of
Microsoft.EntityFrameworkCore.Cosmos
showMicrosoft.Azure.Cosmos >= 3.0.0.1-preview
. This should probably be "=" not ">=" if lack of support for the new versions of the 3.0 Cosmos client is intentional.Steps to reproduce
Install the latest (or any version after 3.0.0.1)
Microsoft.Azure.Cosmos
from NuGet. InstallMicrosoft.EntityFrameworkCore.Cosmos
preview 5 or 6.Try to create a model object and add it to the database. Upon calling
SaveChanges()
on the context, the exception indicated above will be thrown.Further technical details
EF Core version: 3.0.0-preview5.19227.1
Database Provider: Microsoft.EntityFrameworkCore.Cosmos
Operating system: Windows 10
IDE: Visual Studio 2019 Preview 3
The text was updated successfully, but these errors were encountered: