hor*_*HAY 5 c# azure azure-functions
我知道这个问题在网络和 stackoverflow 上被广泛报道,但我可以通过一些额外的帮助来解决这个问题。我收到与加载 Newtonsoft 相关的运行时错误,请参见下文;
[11/07/2020 18:37:17] A ScriptHost error has occurred
[11/07/2020 18:37:17] Exception while executing function: Alerts. EmailSender: Could not load file or assembly 'Newtonsoft.Json, Version=12.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed' or one of its dependencies. The system cannot find the file specified. mscorlib: Could not load file or assembly 'Newtonsoft.Json, Version=11.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed' or one of its dependencies. The system cannot find the file specified.
[11/07/2020 18:37:17] Exception while executing function: Alerts
[11/07/2020 18:37:17] Exception while executing function: Alerts. EmailSender: Could not load file or assembly 'Newtonsoft.Json, Version=12.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed' or one of its dependencies. The system cannot find the file specified. mscorlib: Could not load file or assembly 'Newtonsoft.Json, Version=11.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed' or one of its dependencies. The system cannot find the file specified.
[11/07/2020 18:37:17] Function completed (Failure, Id=850be268-8e38-409d-aa59-fa071567779e, Duration=10672ms)
Run Code Online (Sandbox Code Playgroud)
我已遵循并实现了本博客中所述的绑定重定向。我的 azure 函数是 .net472 的版本 1 函数,我使用 Microsoft.NET.Sdk.Functions 版本 1.0.36。
当调用引用的项目时,会发生异常,在该项目中存在对 Newtonsoft 10.0.2 的引用。
非常感谢任何帮助 - 谢谢!
您需要将 Newtonsoft 降级到 9.0.1。您最好阅读有关 v1/v2 重大更改的信息,并将您的函数重写到 .net core。
https://github.com/Azure/app-service-announcements/issues/129
| 归档时间: |
|
| 查看次数: |
2744 次 |
| 最近记录: |