azure - 为 eventthub 触发器获取 Azure.WebJobs.Host.Listeners.FunctionListenerException
问题描述
我正在使用 azure webjobs v3 来触发 eventthub。直到某个时候一切正常。突然我变得低于错误。有人可以帮我解决这个问题吗?
public async Task Trigger00([EventHubTrigger("%eventhub-00%", Connection = "ConnectionString")] string message)
{
blah...
}
Host.Startup[0]
The listener for function 'Trigger00' was unable to start.
Microsoft.Azure.WebJobs.Host.Listeners.FunctionListenerException: The listener for function 'Trigger00' was unable to start. ---> System.MissingMethodException: Method not found: 'Void Microsoft.Azure.EventHubs.EventHubsException..ctor(Boolean, System.String, System.Exception)'.
at Microsoft.Azure.EventHubs.Processor.EventProcessorConfigurationException..ctor(String message, Exception innerException)
at Microsoft.Azure.EventHubs.Processor.PartitionManager.GetPartitionIdsAsync()
at Microsoft.Azure.EventHubs.Processor.PartitionManager.GetPartitionIdsAsync()
at Microsoft.Azure.EventHubs.Processor.PartitionManager.InitializeStoresAsync()
at Microsoft.Azure.EventHubs.Processor.PartitionManager.StartAsync()
at Microsoft.Azure.EventHubs.Processor.EventProcessorHost.RegisterEventProcessorFactoryAsync(IEventProcessorFactory factory, EventProcessorOptions processorOptions)
at Microsoft.Azure.WebJobs.EventHubs.EventHubListener.StartAsync(CancellationToken cancellationToken) in C:\projects\azure-webjobs-sdk-rqm4t\src\Microsoft.Azure.WebJobs.Extensions.EventHubs\Listeners\EventHubListener.cs:line 46
at Microsoft.Azure.WebJobs.Host.Listeners.FunctionListener.StartAsync(CancellationToken cancellationToken, Boolean allowRetry) in C:\projects\azure-webjobs-sdk-rqm4t\src\Microsoft.Azure.WebJobs.Host\Listeners\FunctionListener.cs:line 68
--- End of inner exception stack trace ---
解决方案
我通过删除对 Microsoft.Azure.EventHubs 4.1.0 的直接依赖解决了这个问题。
Microsoft.Azure.WebJobs.Extensions.EventHubs
3.0.6 依赖于Microsoft.Azure.EventHubs
(2.1.0)的旧版本。我已阅读此包中有重大更改,这可能解释了该错误。
前:
<PackageReference Include="Microsoft.ApplicationInsights" Version="2.10.0" />
<PackageReference Include="Microsoft.Azure.Cosmos" Version="3.1.1" />
<PackageReference Include="Microsoft.Azure.EventHubs" Version="4.1.0" />
<PackageReference Include="Microsoft.Azure.WebJobs.Extensions.EventHubs" Version="3.0.6" />
<PackageReference Include="Microsoft.NET.Sdk.Functions" Version="1.0.29" />
后:
<PackageReference Include="Microsoft.ApplicationInsights" Version="2.10.0" />
<PackageReference Include="Microsoft.Azure.Cosmos" Version="3.1.1" />
<PackageReference Include="Microsoft.Azure.WebJobs.Extensions.EventHubs" Version="3.0.6" />
<PackageReference Include="Microsoft.NET.Sdk.Functions" Version="1.0.29" />
推荐阅读
- java - 使用 admob 奖励广告时的 Java.lang.verifyerror
- android - 在共享目录中创建和使用 Android AVD
- c++ - 为 Mac 构建时,.o 文件中有数十个“建筑的未定义符号......”
- multithreading - 不使用计数器的可重用障碍算法
- swift - 如何将绑定变量传递给 ObservableObject?
- javascript - 从 Shopify react 应用程序中获取 shopOrigin 的最佳方式是什么?
- powerbi - DAX 语句不返回空白
- sql - SQL 连接 3 个不同的查询
- android - 无法在 Android 设备上打开 .apk 文件
- reactjs - 句柄输入类型号增加 - 减少 React 中的句柄