function - Azure function wants two versions of the same DLL
问题描述
I have an azure function that calls a static method from a DLL I created separately and uploaded to the function folder, along with all of its dependencies (all dll's from the release folder were uploaded to the azure function).
When i try to call the function i receive an error Could not load file or assembly 'Microsoft.SharePoint.Client.Runtime, Version=16.1.3912.1204
If i upload this version of Microsoft.SharePoint.Client.Runtime, i receive an error that it wants the other version again: Could not load file or assembly 'Microsoft.SharePoint.Client.Runtime, Version=16.0.0.0
How can this be? It runs successfully outside Azure. Why does it want two versions of the same DLL? The project references 16.1.3912.1204, and this is the version of the dll in the \bin\release folder.
Side note: my .NET GAC folder contains version 16.0.0.0. If it is the case that for some reason inside the Microsoft.SharePoint.Client dll's it needs to reference both versions, how can i include two versions of the same file in an azure function?
解决方案
确保所有项目引用都指向包文件夹 (nuget) dll 以消除版本冲突,然后从 bin 文件夹上传所有 DLL 解决了这种情况下的问题。
推荐阅读
- powershell - Powershell 使用另一个变量引用更新变量
- jquery - 如何从jQuery中的侦听器函数获取事件调用者
- python-3.x - 使用 Python 向子字符串添加值的建议
- javascript - svg 文件中的 JavaScript 上下文
- r - 用其他列的最后观察值填充 NA,通过添加一些常数进行修改
- php - 在 laravel 5.5 中加入子查询如何?
- bash - 尝试创建 .txt 文件的备份,该文件将重命名 txt 文件的后缀
- python - 从 API 获取标头
- php - 需要将静态文本添加到使用 foreach 的 PHP 电子邮件正文
- python - 尝试搜索 yahoo 时出错