Azure / azure-cosmos-table-dotnet

.NET SDK for Azure Cosmos Table API
14 stars 6 forks source link

Duplicate type Microsoft.Azure.Documents.Client.DocumentClient #28

Closed jason-bragg closed 4 years ago

jason-bragg commented 4 years ago

We are updating our azure table storage to use Microsoft.Azure.Cosmos.Table 1.0.6 on framework net462. The service also uses Microsoft.Azure.DocuementDb 2.4.0.

The update is failing to build due to a duplicate type Microsoft.Azure.Documents.Client.DocumentClient which is defined in both Microsoft.Azure.DocumentDb.Core 2.1.3 (included from Microsoft.Azure.Cosmos.Table 1.0.6) and Microsoft.Azure.Documents.Client 2.4.0 (included from Microsoft.Azure.DocumentDb 2.4.0).

"Error CS0433 The type 'DocumentClient' exists in both 'Microsoft.Azure.DocumentDB.Core, Version=2.1.3.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' and 'Microsoft.Azure.Documents.Client, Version=2.4.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'"

Can anyone advise which versions we should be on to avoid this? Thanks.

ordinaryorange commented 4 years ago

I think this library does both Table Storage and Cosmos DB, so you should be able to replace all your old DocumentDB references with the implementation in this library.

jason-bragg commented 4 years ago

@ordinaryorange, Thanks.

Seems to build after replacing Microsoft.Azure.DocuementDb 2.4.0 with Microsoft.Azure.Cosmos.Table 1.0.6. I am concerned that Microsoft.Azure.Cosmos.Table 1.0.6 includes Microsoft.Azure.DocumentDb.Core 2.1.3 when we were previously running against Microsoft.Azure.DocuementDb 2.4.0. Do you know if that is a back-rev, and if that could effect our persisted state in production? We've testing, but I'm not sure if we specifically cover pre-existing persisted state.

I'm wondering if Microsoft.Azure.DocumentDb.Core should be aligned by version with Microsoft.Azure.DocuementDb 2.4.0.

ordinaryorange commented 4 years ago

DocumentDb.core is the .NETStandard implementation. Comparison to the .NET Framework version does not make sense. As with any migration to .NET standard/core from .NET framework there might be things that are not implemented so you will need to run all your tests. I see that Cosmos.Table 2.0.0 pre-release drops the DocumentDb dependency.

sakash279 commented 4 years ago

I am concerned that Microsoft.Azure.Cosmos.Table 1.0.6 includes Microsoft.Azure.DocumentDb.Core 2.1.3 when we were previously running against Microsoft.Azure.DocuementDb 2.4.0. Do you know if that is a back-rev, and if that could effect our persisted state in production?

Sorry for the late response, this is not a back rev. This is the minimum version compatibility. Anything > 2.1.3 should work. We've tested up to versions 2.9.0 and that worked fine in terms of compat.