我该如何解决 ?:/
public static async Task<bool> Run([QueueTrigger("<queueNameHere", Connection = "<connectionHere>")]byte[] myQueueItem, TraceWriter log)
Run Code Online (Sandbox Code Playgroud)
结果出现错误:
Microsoft.Azure.WebJobs.Host: Error indexing method 'Run'.
Microsoft.Azure.WebJobs.Host: Cannot bind parameter '$return' to type
Boolean&. Make sure the parameter Type is supported by the binding. If
you're using binding extensions (e.g. ServiceBus, Timers, etc.) make
sure you've called the registration method for the extension(s) in
your startup code (e.g. config.UseServiceBus(), config.UseTimers(),
etc.).
Run Code Online (Sandbox Code Playgroud)
该错误源于以下事实:您试图将返回类型设置为布尔值(任务),并且我相信 QueueTriggered 函数的返回类型只能为 void。所以只需删除返回类型:
public static async Task Run(...)
Run Code Online (Sandbox Code Playgroud)
您尝试使用返回类型是否有特定目的?如果您尝试将状态传递给另一个进程,那么您应该考虑一种替代方法,例如通过输出绑定将已完成的消息放置在另一个队列上或更新数据库中的状态等。
| 归档时间: |
|
| 查看次数: |
2533 次 |
| 最近记录: |