C# 无法绑定参数';编排上下文';将DurableOrchestration与Azure函数一起使用时键入DurableOrchestration上下文
我正在尝试在Azure功能中使用新的持久功能扩展。我在我的功能项目中安装了此Nuget软件包: Microsoft.Azure.WebJobs.Extensions.DurableTask 然后在我的函数中使用DurableOrchestrationContext,如下所示:C# 无法绑定参数';编排上下文';将DurableOrchestration与Azure函数一起使用时键入DurableOrchestration上下文,c#,azure,azure-functions,azure-durable-functions,azure-triggers,C#,Azure,Azure Functions,Azure Durable Functions,Azure Triggers,我正在尝试在Azure功能中使用新的持久功能扩展。我在我的功能项目中安装了此Nuget软件包: Microsoft.Azure.WebJobs.Extensions.DurableTask 然后在我的函数中使用DurableOrchestrationContext,如下所示: [FunctionName("StopVM")] public static void StopVM([TimerTrigger("0 */2 * * * *")]TimerInfo myTimer, ILogger lo
[FunctionName("StopVM")]
public static void StopVM([TimerTrigger("0 */2 * * * *")]TimerInfo myTimer, ILogger log, ExecutionContext context, DurableOrchestrationContext orchestrationContext)
{
....
}
但当我运行函数时,此错误显示:
错误索引方法“FuncApp.StopVM”[20/11/2018
17:09:01]Microsoft.Azure.WebJobs.Host:索引方法出错
“FuncApp.StopVM”。Microsoft.Azure.WebJobs.Host:无法
将参数“orchestrationContext”绑定到类型
DurableOrchestrationContext。确保参数类型受支持
通过装订。如果您使用的是绑定扩展(例如Azure
存储、服务总线、计时器等)请确保已呼叫
启动代码中扩展的注册方法(例如。
builder.AddAzureStorage(),builder.AddServiceBus(),
builder.AddTimers()等)
我是否遗漏了一些步骤,如向startup类添加任何中间件等,导致文档没有清楚显示如何使用它?我明白了。如果要启动业务流程本身或使用此属性
[OrchestrationTrigger]包装DurableCorchestrationClient
类型的参数,则应使用此属性包装DurableCorchestrationClient
类型的参数
使用上下文,这里有更多详细信息()