我认为这是文档过时的情况,但我找不到更新的示例。
使用以下代码会在 webjob 的初始化时产生异常,并且它会卡在“等待重启”循环中。
public static void GenerateExcelFile(
[QueueTrigger("excel")] JobFile message,
Guid Id,
[Table("JobFile")] IDictionary<Tuple<string, string>, object> table,
{
//More Code
}
用“JobFile”替换“object”会产生同样的错误。这是一个相当长的堆栈跟踪,所以我只在这里发布了它的顶部。使用 ILSpy 看起来这应该不起作用,所以我不确定自编写教程以来是否已删除此功能。
[09/13/2014 11:07:53 > be5c40: ERR ] Unhandled Exception:
Microsoft.Azure.WebJobs.Host.Indexers.FunctionIndexingException:
Error indexing method 'GenerateExcelFile' --->
System.InvalidOperationException: Can't bind Table to type
'System.Collections.Generic.IDictionary`2[System.Tuple`2[System.String,System.String],System.Object]'.
[09/13/2014 11:07:53 > be5c40: ERR ] at Microsoft.Azure.WebJobs.Host.Tables.TableAttributeBindingProvider.TryCreateAsync(BindingProviderContext context)
[09/13/2014 11:07:53 > be5c40: ERR ] at Microsoft.Azure.WebJobs.Host.Bindings.CompositeBindingProvider.<TryCreateAsync>d__0.MoveNext()
我在 SDK 的 0.5 beta 和 0.6 beta 上试过这个。