【发布时间】:2019-08-20 13:24:38
【问题描述】:
为 dotnet core 2.2 构建
我包括以下内容:
using Microsoft.Azure.EventHubs; (4.0.0)
using Microsoft.Azure.EventHubs.Processor; (4.0.0)
我试图抛出一个异常:
_eventProcessorHost = new EventProcessorHost(
hubName,
PartitionReceiver.DefaultConsumerGroupName,
_eventHubConnectionString,
_storageConnectionString,
blobName);
异常说:
“无法从程序集 'Microsoft.Azure.Storage.Common, Version=11.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' 中加载类型 'Microsoft.WindowsAzure.Storage.CloudStorageAccount'”
当我查看存根时,我确实可以看到 EventProcessorHost 的各种构造函数确实引用了旧命名空间中的成员——例如 Microsoft.WindowsAzure.Storage.CloudStorageAccount。
我的理解是旧空间 Microsoft.WindowsAzure 已完全被新空间 Microsoft.Azure 取代。我还需要导入旧空间吗?
尝试安装 Microsoft.WindowsAzure.Common,卸载并重新安装 WindowsAzure 库。
【问题讨论】:
-
您参考哪个版本的 EventHub nuget 包?
-
我使用的是 4.0.0
-
嗯,至少基于 Nuget 页面,它不应再引用 WindowsAzure...
-
我下载了你引用的源码。在 \eventhub\Microsoft.Azure.EventHubs.Processor 中,您可以看到包含 WindowsAzure: namespace Microsoft.Azure.EventHubs.Processor { using System;使用 System.Threading.Tasks;使用 Microsoft.Azure.EventHubs.Primitives;使用 Microsoft.WindowsAzure.Storage; ...... }
标签: azure .net-core storage azure-eventhub