Azure 设置的格式必须为;名称=值";在Eventhub客户端创建中

Azure 设置的格式必须为;名称=值";在Eventhub客户端创建中,azure,azure-storage,azureservicebus,Azure,Azure Storage,Azureservicebus,Microsoft.WindowsAzure.Storage.dll中发生“System.FormatException”类型的异常,但未在用户代码中处理 附加信息:设置必须采用“名称=值”的形式 在EventHub中创建eventProcessorHost时 var eventProcessorHost = new EventProcessorHost( EhEntityPath, EventHubConsumerGroup.D

Microsoft.WindowsAzure.Storage.dll中发生“System.FormatException”类型的异常,但未在用户代码中处理

附加信息:设置必须采用“名称=值”的形式

在EventHub中创建eventProcessorHost时

 var eventProcessorHost = new EventProcessorHost(
                EhEntityPath,
                EventHubConsumerGroup.DefaultGroupName,
                EhConnectionString,
                StorageConnectionString,
                StorageContainerName);
样本值

 string EhConnectionString = "Endpoint=sb://namespacename-ns.servicebus.windows.net/;SharedAccessKeyName=receivepolicy;SharedAccessKey=v7IHIH+jB3+H2UMxEOr9kHYfhwj1Q=;EntityPath=sampleeventhub";
 string EhEntityPath = "sampleeventhub";
 string StorageContainerName = "containername"; //I have created in blob and type as container
 string StorageAccountName = "storegenameinazure";
 string StorageAccountKey = "GHasmRRJgI5s123ziDlfOKQ7IBrO23EvHpk++TV0L2hU2erdI7PyY+gtvUop67lIU0+zQsM09sQ==";

  static readonly string StorageConnectionString = string.Format("DefaultEndpointsProtocol=https;AccountName={0};AccountKey={1}", StorageAccountName, StorageAccountKey);

根据您的描述,我使用版本(2.2.10)来测试这个问题

Microsoft.WindowsAzure.Storage.dll中发生“System.FormatException”类型的异常,但未在用户代码中处理。其他信息:设置的格式必须为“名称=值”

根据您的代码,我假设您没有正确构建
EventProcessorHost
构造函数,您使用的构造函数如下所示:

此时,您传递的参数
StorageContainerName
将被视为
storageConnectionString
参数,然后出现上述错误


总之,请使用正确的构造函数构建您的
EventProcessorHost
。以下是一些教程,您可以参考它们(和)。

您解决了这个问题吗?如果有任何问题,请告诉我。