无法在Azure函数v1中绑定ILogger [英] Can not bind ILogger in azure function v1

查看:58
本文介绍了无法在Azure函数v1中绑定ILogger的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我用参数ILogger创建了一个azure函数v1,当我按下F5时,控制台窗口出现以下异常:

I have created an azure function v1 with parameter ILogger and when I hit F5 the console window has this exception:

Run: Microsoft.Azure.WebJobs.Host: Error indexing method Microsoft.Azure.WebJobs.Host: Cannot bind parameter 'logger' to type ILogger azure function

v1 Azure功能仅适用于TraceLogger吗?

Does v1 azure function only work with TraceLogger ?

它可以使用azure函数v2来工作,但这就是.Net Core,这对我来说是不可行的选择.

It worked using azure function v2, but that is .Net Core which is no option for me.

推荐答案

我在我这边对其进行了测试, TraceWriter ILogger 在我的函数V1中都可以正常工作.当我从本地发布到天蓝色时,它也可以正常工作.因此,请您检查一下是否已经安装了nuget软件包,并在功能代码中成功使用了它们.

I test it in my side, both TraceWriter and ILogger works fine in my function V1. And when I publish it from local to azure, it also works as expect. So could you please check if you have installed the nuget packages and using them success in your function code.

我在下面提供我的功能代码供您参考:

I provide my function code below for your reference:

这篇关于无法在Azure函数v1中绑定ILogger的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆