繁体   English   中英

无法在 VS2015 中安装程序包 Azure.Storage.Blobs.12.5.1

[英]Can't Install Package Azure.Storage.Blobs.12.5.1 in VS2015

我正在尝试开始使用 Azure Blob 存储。 我正在运行 VS2015,但我安装了 .NET 4.8 SDK 并将我的项目设置为目标。 当我尝试安装 NuGet 包时,我得到以下信息:

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.

根据这个https://docs.microsoft.com/en-us/dotnet/standard/net-standard#net-implementation-support .NET 4.7.2 相当于.NET standard 2.0,这似乎是什么包想要。 但是我已经尝试过 .NET 4.7.2 和 4.8 并且该软件包没有安装。

Azure.Storage.Blobs仅适用于 .NET Standard。

我相信您需要将Microsoft.Azure.Storage.Blob用于 .NET Framework(最低 4.5.2)

链接到 Nuget 在这里

预计到达时间:

我刚读了你问题的另一半。 .NET Framework 4.6.1 符合 .NET Standard 2.0。

我打算在这里说一下,Visual Studio 2015 和 .NETStandard 2.0 包之间存在某种不兼容。 我在 Visual Studio 2019 上的 .NET Framework 4.6.1 项目上对其进行了测试,并且安装包很好。

刚刚查了一下,确实是这样 您至少需要 Visual Studio 2017。 至少您仍然可以使用Microsoft.Azure.Storage.Blob

所以 Azure 真的希望你使用 VS 2017 或更高版本。

为了在从 TFS 中提取后在 VS 2015 上工作,我执行了以下操作:

  1. 为 VS 2015 安装 NuGet 3.6.0 或更高版本:

https://www.nuget.org/downloads

  1. 然后为 VS 2015 安装 .NET Standard 支持:

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

  1. 为 Azure 安装最新的 NuGet 包(确保不要获取已弃用但名称几乎相同的旧包):

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

  1. 由于 MS 尚未修复的已知问题,该解决方案将无法构建。 所以在记事本中打开.vbproj文件。 在第一个PropertyGroup下,在结束标记之前添加以下行:

<ImplicitlyExpandDesignTimeFacades>false</ImplicitlyExpandDesignTimeFacades>

它不是 Visual Studio(在 VS 2017、2019 中得到相同的错误),而是项目需要是 .Net Core 而不是 .Net Framework。 如前所述,您可以安装 Microsoft.Azure.Storage.Blob,但您会收到一条警告,指出包已被弃用(并且说使用 Azure.Storage.Blob 代替)

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM