0

I'm trying to get started with Azure Blob storage. I'm running VS2015 but I installed the .NET 4.8 SDK and set my project to target it. When I try to install the NuGet package, I get this:

Could not install package 'Azure.Storage.Blobs 12.5.1'. You are trying to install this package into a project that targets '.NETFramework,Version=v4.8', but the package does not contain any assembly references or content files that are compatible with that framework.

According to this https://learn.microsoft.com/en-us/dotnet/standard/net-standard#net-implementation-support .NET 4.7.2 is equivalent to .NET standard 2.0, which seems to be what the package wants. But I've tried .NET 4.7.2 and 4.8 and the package doesn't install.

John
  • 2,653
  • 4
  • 36
  • 57

3 Answers3

2

So Azure really wants you to be on VS 2017 or higher.

To get this working on VS 2015 after pulling from TFS I did the following:

  1. Install NuGet 3.6.0 or higher for VS 2015:

https://www.nuget.org/downloads

  1. Then install .NET Standard support for VS 2015:

https://download.microsoft.com/download/0/F/D/0FD852A4-7EA1-4E2A-983A-0484AC19B92C/dotnet-standard-support-vs2015-2.0.0-win-x86.msi

  1. Install the latest NuGet package for Azure (be sure not to grab the deprecated but nearly identically-named older package):

https://www.nuget.org/packages/Azure.Storage.Blobs/

  1. The solution won't build because of a known issue that MS hasn't fixed. So open the .vbproj file in notepad. Under the first PropertyGroup add this line before the closing tag:

<ImplicitlyExpandDesignTimeFacades>false</ImplicitlyExpandDesignTimeFacades>

John
  • 2,653
  • 4
  • 36
  • 57
1

Azure.Storage.Blobs is .NET Standard only.

I believe you need to use Microsoft.Azure.Storage.Blob for .NET Framework (4.5.2 minimum)

Link to Nuget is here.

ETA:

I just read the other half of your question. .NET Framework 4.6.1 is .NET Standard 2.0 compliant.

I am going to go out on a limb here and say there is some sort of incompatibility between Visual Studio 2015 and .NETStandard 2.0 packages. I tested it on Visual Studio 2019 on a .NET Framework 4.6.1 project and it installed the package just fine.

Just looked it up, and it is the case. You need Visual Studio 2017 at a minimum. At least you can still use Microsoft.Azure.Storage.Blob.

Andy
  • 12,859
  • 5
  • 41
  • 56
  • So I only develop for Windows. I’ve heard of .NET Core, what is .NET standard? Is Microsoft planning on consolidating these frameworks? – John Aug 24 '20 at 19:02
  • @John -- i just tried to install `Azure.Storage.Blobs` on a .NET 4.6.1 project and it worked just fine (in Visual Studio 2019). I am going to go out on a limb here and say it's an incompatibility between Visual Studio 2015 and .NET Standard. – Andy Aug 24 '20 at 19:11
0

It isn't Visual Studio (get the same error in VS 2017, 2019), it is that the project needs to be .Net Core instead of .Net Framework. As stated prior, you can install Microsoft.Azure.Storage.Blob, but you do get a warning that package is deprecated (and its says use Azure.Storage.Blob instead)