c# - 无法在 Azure Functions 中加载文件或程序集 'Newtonsoft.Json, Version=10.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed'

标签 c# azure json.net azure-functions serverless

我正在从我的 Azure Function(服务总线队列触发器)引用 C# 库项目。该库引用 Newtonsoft nuget 版本 10.0.1。 在我的 Visual Studio 上本地运行该函数时,出现此错误。

{"Could not load file or assembly 'Newtonsoft.Json, Version=10.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed' or one of its dependencies. The system cannot find the file specified.":"Newtonsoft.Json, Version=10.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed"}

我尝试降级到版本 10.0.0,但问题仍然存在。

我偶然发现了这个问题链接:https://github.com/Azure/azure-functions-vs-build-sdk/issues/107 。 并尝试降级到9.0.1。但即使如此,错误仍然发生。

注意:该库项目引用了其他几个库项目,这些项目也引用了 Newtonsoft。我在所有子项目中保留相同版本的 nuget。

如何解决这个问题?

最佳答案

将所有子库中的所有 Newtonsoft dll 指向版本 9.0.1 解决了该问题。

关于c# - 无法在 Azure Functions 中加载文件或程序集 'Newtonsoft.Json, Version=10.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed',我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47351068/

相关文章:

c# - 在 wpf 中绘制图表

c# - IIS/.Net 只允许对给定用户 session 的单个并发响应

azure - 通过 Microsoft.WindowsAzure.ServiceRuntime 检测 Azure Stage 或 Production

Azure 事件网格多次触发 Azure Function App,而不是一次

azure - Azure 中单个 VM 上连续 Webjob 的多个实例

c# - 使用 Newtonsoft 解析 json 字符串会引发 Null 引用执行

c# - JsonConvert.DeserializeObject 的 JSON.net 问题

C# .net MVC,设置 Google Application Credentials JSON 文件的路径

c# - 从表中选择,然后将 (value + 1) 插入到另一个表中?

c# - 反序列化派生类时如何忽略基类JsonConverter?