我目前Json.Net
在整个项目中都在使用它,它就像一个魅力。不幸的是,Azure Functions 的输入绑定用于System.Text.Json
反序列化 EventGrid 事件 json 并将其绑定到库中的EventGridEvent
对象Azure.Messaging.EventGrid 4.0.0.-beta.4
看看这里:https ://github.com/Azure/azure-functions-host/issues/5469
这会导致大量问题,因为我的所有习惯JsonConverters
根本不起作用,这会导致对象反序列化不正确。Newtonsoft.Json
从to更改System.Text.Json
为大量返工,如果可以的话,我绝对希望避免这种情况。
有没有办法强制使用输入绑定Json.Net
而System.Text.Json
不是通过 DI inFunctionssStartup.Configure()
或其他方式?