Use the Azure Storage library in .NetCore Application

 

Today, I would like to use the Microsoft Azure Storage from .NetCore Application hosted on linux. The azure storage SDK is available on Github https://github.com/Azure/azure-storage-net and the readme indicate the targeted platforms :

Netstandard1.3 (CoreCLR RTM): Storage Client Libraries for .NET are available to support CoreCLR application development.

Ok ! so a nuget should be available for my project.

I’ve created a new .Net Core App console in my Visual studio, and then try to install the nuget package (7.2.1) :

image

It seems that there is a .NetStandard compatible version :

image

but after installing the nuget, I get the following errors :

Package XXX is not compatible with netcoreapp1.0

image

image

hum !

How to fix it? because the Github readme seems to explains that it could work on .NetCore.

I’ve done the same manipulation in a AspNet Core application and everything build successfully … Triste

I’ve looked in the project.json and I’ve seen the difference.

In the project.json of the Console App :

“frameworks”: {
   “netcoreapp1.0”: {
     “imports”: “dnxcore50”
   }
}

In the project.json of the AspNet Core App :

“frameworks”: {
   “netcoreapp1.0”: {
     “imports”: [
       “dotnet5.6”,
       “portable-net45+win8”
     ]
   }
},

 

Catch! 

So I’ve changed the import property to include dotnet5.6 and portable-net45+win8 and voila ! The project successfully load the nuget and compile.

After I’ve deployed the console app on a Linux and everything works fine !

HTH !

This entry was posted in Azure, English and tagged , . Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s