I have a console application that is using both the Microsoft.Azure.DocumentDB.Core library and the Microsoft.Azure.Cosmos.Table library. There is an enum in the Microsoft.Azure.Cosmos namespace named ConsistencyLevel which is throwing errors about an ambiguous reference.
I don't know if there is a good solution to this since right now the CosmosClient for Core SQL needs to set this.
Is Microsoft planning on fixing this issue since it restricts a developer from using both libraries in the same project? In terms of code, I have a method attempting to create a new client in the DocumentDb SDK.
public void Initialize(int maxConnections)
{
this.client = new CosmosClient(this.config.Uri, this.config.AuthKey,
new CosmosClientOptions()
{
MaxRetryAttemptsOnRateLimitedRequests = 9,
MaxRetryWaitTimeOnRateLimitedRequests = TimeSpan.FromSeconds(15),
ApplicationRegion = Regions.EastUS2,
ConnectionMode = ConnectionMode.Direct,
ConsistencyLevel = ConsistencyLevel.Eventual
});
this.container = this.client.GetContainer(this.config.DatabaseName, this.config.ContainerName);
}
The error is:
Severity Code Description Project File Line Suppression State
Error CS0433 The type 'ConsistencyLevel' exists in both 'Microsoft.Azure.Cosmos.Client, Version=3.3.2.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' and 'Microsoft.Azure.Cosmos.Table, Version=1.0.5.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' DataLoader C:\Source\Repos\poc\DataLoader\CosmosSdkv3Context.cs 69 Active