【问题标题】:Azure Functions Errro - Could not load file or assembly System.Configuration.ConfigurationManager, Version=4.0.3.0Azure Functions Errro - 无法加载文件或程序集 System.Configuration.ConfigurationManager,版本 = 4.0.3.0
【发布时间】:2020-07-01 11:40:38
【问题描述】:

我正在研究 Azure Functions,它们是在 .Net Core 3.1 版中创建的,而其他库是在 .Net Framework 4.8 中编写的。在执行函数时,我收到以下错误 -

System.Private.CoreLib:执行函数时出现异常:XXXXXX。 System.Private.CoreLib:出现一个或多个错误。 ('XXXXX' 的类型初始化程序引发了异常。)。 XXXX.Service:“XXXXX.Service.XXXXX”的类型初始化程序引发了异常。 XXXX.Service:无法加载文件或程序集“System.Configuration.ConfigurationManager,版本=4.0.3.0,文化=中性,PublicKeyToken=cc7b13ffcd2ddd51”。系统找不到指定的文件。

建议将不胜感激。

【问题讨论】:

  • 你有可以访问的库吗?检查stackoverflow.com/a/50563417/5853218
  • 从nuget官网找不到这个nuget包。 nuget.org/packages/System.Configuration.ConfigurationManager/…
  • 我今天遇到了同样的问题: Could not load file or assembly 'System.Configuration.ConfigurationManager, Version=4.0.3.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51'. The system cannot find the file specified. 当我查看 bin 目录时,我没有看到 DLL。我在我的包目录中也找不到它,但它说已安装。
  • 同样的错误。没有该特定版本的软件包,也没有明确引用它。

标签: .net-core azure-functions .net-framework-version


【解决方案1】:

确保您的软件包版本存在。从这里看来,没有您报告错误的软件包版本,请查看此链接:

https://www.nuget.org/packages/System.Configuration.ConfigurationManager/5.0.0-preview.1.20120.5

点击版本历史,你会发现:

【讨论】:

  • 这不是答案。 Azure Functions 有很多限制。在生产中发布它是荒谬的。
猜你喜欢
  • 1970-01-01
  • 2021-06-26
  • 2021-02-24
  • 2017-07-25
  • 2016-12-16
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多