我有一个带有许多依赖项的 Azure Function,包括 Nuget.Versioning
和Microsoft.Extensions.Logging.Abstractions
.
当我尝试启动我的函数(本地或部署)时,会导致这些文件出现错误:
System.Private.CoreLib: Could not load file or assembly 'Microsoft.Extensions.Logging.Abstractions, Version=5.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60'. The system cannot find the file specified.
正确的版本位于 bin 目录中,因此当我查看加载的模块时,我可以看到这些依赖项的旧版本,它们已经加载,位于:
C:\Users\<user>\AppData\Local\AzureFunctionsTools\Releases\3.23.5\cli_x64
有没有比让我的 nuget 依赖项针对任何 AzureFunctionsTools
的相同版本更好的方法? ' 依赖关系?
随机浏览长长的列表AzureFunctionsTools
依赖项有很多已经过时了。我的功能使用.net core 3.1。
最佳答案
您可以尝试降级所有 5.0.0 库,例如 Microsoft.EntityFrameworkCore.SqlServer
、Microsoft.EntityFrameworkCore
和 Microsoft.EntityFrameworkCore.SqlServer.NetTopologySuitefrom
5.0 到 3.1.x。
或者,升级到.Net 5
请引用GitHub issue和 SO Thread类似问题的进一步引用。
关于Azure Functions 依赖项与 AzureFunctionsTools 依赖项发生冲突,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/69110549/