Cannot add dependency "WindowsAzure.Storage" to .Net Core class library (ASP.NET 5)

My project solution is configured in this way, contains the following projects

MyProjectSolution.sln MyProject.WebPI(Asp.net 5 WebAPI) MyProject.Data(Asp.net 5 class libray) MyProject.Domain(Asp.net 5 class libray) 

I followed the steps listed in the articles below https://azure.microsoft.com/en-us/documentation/articles/vs-azure-tools-connected-services-storage/ and https://azure.microsoft.com/en -us / documentation / articles / vs-storage-aspnet5-getting-started-blobs / which modified my project.json to include this dependency "WindowsAzure.Storage": "4.3.2-preview"

but then an error appeared indicating that WindowsAzure.Storage is not supported in DNXCoreVersion = 5.0

Note: 1) I also tried to add the above dependency manually to check if it did not lead to the same or different error - no change.

2) I tried to look at the sdks% Program Files% \ Microsoft SDKs \ Azure.NET SDK \\ ref \ folder, but could not find it. Attached is a screen shot of the DLLs that I found.

Is there a specific version that I can try? or did i miss something important here?

Thanks! enter image description here

 { "version": "1.0.0-*", "description": "MyProject.Data Class Library", "authors": [""], "tags": [""], "projectUrl": "", "licenseUrl": "", "frameworks": { "dnx451": { /*These were added after I connected to the Azure Storage as seen in the article that did NOT exist before*/ "dependencies": { "Microsoft.Data.Edm": "5.6.3", "Microsoft.Data.OData": "5.6.3", "Microsoft.Data.Services.Client": "5.6.3", "System.Spatial": "5.6.3" } }, "dnxcore50": { "dependencies": { "Microsoft.CSharp": "4.0.1-beta-23516", "System.Collections": "4.0.11-beta-23516", "System.Linq": "4.0.1-beta-23516", "System.Runtime": "4.0.21-beta-23516", "System.Threading": "4.0.11-beta-23516", "System.IO": "4.0.11-beta-23516" } } }, "dependencies": { "MyProject.Domain": "1.0.0-*", "Microsoft.Extensions.Configuration.Json": "1.0.0-rc1-final", /*This was added after I connected to the Azure Storage as seen in the article that did not exist before*/ "WindowsAzure.Storage": "4.3.2-preview", } } 
+5
source share
2 answers

Use 7.0.2-preview

https://www.nuget.org/packages/WindowsAzure.Storage/7.0.2-preview

According to the change, it is updated to use the RC2 release of .Net Core 1.0.

The 7.1.1 preview has been updated to release the RTM version of .Net Core 1.0, but it is not currently available through NuGet. (The NuGet page says: "The owner has blocked this package. This may mean that the package is outdated or should no longer be used.")

Also note that this contains dependencies on ODataLib packages for which there is currently no .Net Core version. See this note for the WindowsAzure.Storage readme , which states:

ODataLib packages currently do not support "netstandard1.6" or "netcoreapp1.0" in projects, depending on the current Dotnet CoreCLR relationship. Thus, you may encounter errors when trying to restore ODataLib dependencies for one of the target frameworks mentioned above. Until support is added, if you come across this, you can use the import statement within the node of your project.json file to tell NuGet that it can recover structure-oriented packages in the import statement as below:

  "imports": [ "dnxcore50", "portable-net451+win8" ] 

EDIT: Use WindowsAzure.Storage 7.1.3-preview

+11
source

This is because Windows Azure Storage 4.3.2-preview nuget is a very old version, published in November 2014, that is not compatible with the current ASP.NET kernel.

http://www.nuget.org/packages/WindowsAzure.Storage/4.3.2-preview

Below you can read the release notes for the nuget package for Windows Azure Storage to get the version / version compatible with the ASP.NET target kernel that you are using.

Release Notes

Hope this helps!

-1
source

Source: https://habr.com/ru/post/1245731/


All Articles