Azure-cosmos-dotnet-v2: Can't resolve Microsoft.Azure.Storage.Common package when pulling down Microsoft.Azure.CosmosDB.Table

Created on 17 Nov 2017  路  11Comments  路  Source: Azure/azure-cosmos-dotnet-v2

image

Inspecting Microsoft.Azure.Storage.Common nuget feed there's only a pre-released version of the package 8.6.0-preview.

Further looking at the dependecies for Table API client, is it correct for a GA-ed library to take a dependency on a preview package?...

.NETFramework 4.5

Microsoft.Azure.DocumentDB (>= 1.19.0)
Microsoft.Azure.KeyVault.Core (>= 1.0.0)
Microsoft.Azure.Storage.Common (>= 8.6.0-preview) <===
Microsoft.Data.OData (>= 5.8.2)
Microsoft.Data.Services.Client (>= 5.8.2)
Microsoft.OData.Core (>= 7.2.0)
Microsoft.OData.Edm (>= 7.2.0)
Microsoft.Spatial (>= 7.2.0)
Newtonsoft.Json (>= 10.0.2)

Most helpful comment

Still not fixed. It's necessary to install using:
Install-Package Microsoft.Azure.CosmosDB.Table -IncludePrerelease

All 11 comments

Tried with VS and package manager console, same problem:
image

Looks like a tooling issue.
If a project is configured to use packages.config this issue will manifest itself.
If a project is configured to use PackageReference, there's no problem with both legacy project system and the new SDK-style projects.

Opened an issue with NuGet https://github.com/NuGet/Home/issues/6196.

Thinking about it, it's not a good practice to mix GA-ed/production grade libraries and preview/beta dependencies. Will keep this open to address that aspect and let team decide what to do about it (potentially another issue).

It's something that should be fixed in the not too distant future. In the meantime we have doc'd the issue and the work around - https://docs.microsoft.com/en-us/azure/cosmos-db/table-sdk-dotnet#troubleshooting

Still not fixed. It's necessary to install using:
Install-Package Microsoft.Azure.CosmosDB.Table -IncludePrerelease

Unfortunately I don't think the workarounds work when using LinqPad, I've submitted a uservoice request so pre-release dependencies can be used in non-prerelease packages:
https://linqpad.uservoice.com/forums/18302-linqpad-feature-suggestions/suggestions/35067427-enable-non-prerelease-package-to-download-pre-rele

I'm having issue with the latest 2.1.0 version as it has a dependency towards Microsoft.Azure.Storage.Common (>= 8.6.0-preview && <= 9.0.0.1-preview) but the latest version of that is 9.4.2 and only as old as 9.4.0 is available.

@oskar-fjeld I had a similar problem and it was a result of 2 issues:

  1. You must target net47 and not netstandard2.0 to use any of the new Microsoft.Azure.Storage packages which includes the Microsoft.Azure.CosmosDB.Table package.

  2. It appears the Microsoft.Azure.CosmosDB.Table package does not play well with any of the other storage packages such as the Microsoft.Azure.Storage.Blob package due to the package version constraints put in place. I had to completely separate them into their own projects.

The screenshot below might help, the top project was my original project that targeted netstandard2.0 with the old WindowsAzure.Storage package. However, after trying to upgrade to the new split up packages, I had to separate them into their own projects both targeting net47 and are the bottom two projects shown.

image

I hope that may help you. I would suggest you just remain on the former WindowsAzure.Storage package if you can until these packages are ready for production use.

Well I can't install Microsoft.Azure.CosmosDB.Table into an net4.7 project as the oldest version of Microsoft.Azure.Storage.Common available to me is 9.4.0. Unless there is some way to do this that I'm not aware off. I've tried to run the command
Install-Package Microsoft.Azure.Storage.Common AzureStorageCacheTable -Version 9.0.0
but that just throws an error.
Are you installing the packages without their dependencies?

Sorry, I just needed to specify the correct version number :
Install-Package Microsoft.Azure.Storage.Common AzureStorageCacheTable -Version 9.0.0.1-preview
And then everything is working fine. Thanks for a great answer btw :)

The current information on the WindowsAzure.Storage package actually instructs you to install Microsoft.Azure.Storage.Blob and Microsoft.Azure.CosmosDB.Table, which are currently still incompatible due to issue mentioned above by @oskar-fjeld with the dependency conflict (i.e. one relies on a version that the other does not support).

Its no problem to stay on the old WindowsAzure.Storage package as it'll work for now, but it would seem to me that splitting these packages currently misses value as it is impossible to upgrade if you need to use both. A solution to this issue would be greatly appreciated because using 'outdated' packages feels like a sub optimal solution as well.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

matthewacme picture matthewacme  路  4Comments

christian-vorhemus picture christian-vorhemus  路  5Comments

cgelon picture cgelon  路  7Comments

RobertoPrevato picture RobertoPrevato  路  5Comments

felschr picture felschr  路  5Comments