【发布时间】:2020-11-01 07:39:00
【问题描述】:
我知道这个问题在网络和 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)
我已经按照in this blog 的描述遵循并实施了绑定重定向。我的天蓝色函数是带有 .net472 的版本 1 函数,我使用的是 Microsoft.NET.Sdk.Functions 版本 1.0.36。
当调用引用的项目时发生异常,在该项目中有对 Newtonsoft 10.0.2 的引用。
非常感谢任何帮助 - 谢谢!
【问题讨论】:
标签: c# azure azure-functions