在本地运行 Azure 函数(V2)时抛出 Newtonsoft.Json.JsonReaderException [英] Newtonsoft.Json.JsonReaderException thrown when running Azure function(V2) locally

查看:21
本文介绍了在本地运行 Azure 函数(V2)时抛出 Newtonsoft.Json.JsonReaderException的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在VS2017中创建了Azure函数v2的队列触发模板.当我在本地运行项目时,函数运行时成功启动.但是当我在队列中创建消息时,VS 下载了一个 JsonSerialization.cs 文件并指出了错误.

I created a queue trigger template of Azure function v2 in VS2017. When I ran the project locally, the function runtime started successfully. But when I created a message in the queue, VS downloaded a JsonSerialization.cs file and pointed out the error.

默认异常设置的详细信息:

Details of default Exception settings:

这是一个由VS生成的模板,所以似乎没有我在其他帖子中发现的代码问题.

It's a template generated by VS, so there seems no code issue like what I have found in other posts.

我尝试过的:

  • 将项目发布到 Azure,工作正常.
  • 使用 npm 安装的功能核心工具(Cli)运行项目,也可以.

我猜这个问题与VS使用的函数Cli有关.但是它的runtime版本是2.0.11651.0,和npm安装的一样.

I guess the problem is related to the function Cli used by VS. But its runtime version is 2.0.11651.0, same as the one installed by npm.

有没有人遇到过这种情况或有任何想法?提前致谢.

Have anyone met this before or got any idea? Thanks in advance.

推荐答案

这个异常是内部的,应该被运行时捕获.在异常设置中随意忽略它,然后一切都应该正常工作.

This exception is internal and should be caught by the runtime. Feel free to ignore it in exception settings, and then everything should just work.

这篇关于在本地运行 Azure 函数(V2)时抛出 Newtonsoft.Json.JsonReaderException的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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