Azure Function异常无法加载ActiveDirectory文件或程序集 [英] Azure Function exception could not load ActiveDirectory file or assembly

查看:85
本文介绍了Azure Function异常无法加载ActiveDirectory文件或程序集的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图编写一个将文件写入Azure Datalake的Azure计时器函数,但是当我添加所需的nuGet程序包时,我在启动主机时遇到错误

I am trying to write an azure timer function that writes files to Azure Datalake, but when I am adding the needed nuGet packages I am getting an error when I start the host

错误如下

[21/5/2018 8:36:20 AM] Executed 'NWPimFeederFromAws' (Failed, Id=03395101-41a5-44ef-96d8-f69c5d73eca7)
[21/5/2018 8:36:20 AM] System.Private.CoreLib: Exception while executing function: NWPimFeederFromAws. NWPimFeeder: Could not load file or assembly 'Microsoft.IdentityModel.Clients.ActiveDirectory, Version=3.19.5.13701, Culture=neutral, PublicKeyToken=31bf3856ad364e35'. Could not find or load a specific file. (Exception from HRESULT: 0x80131621). System.Private.CoreLib: Could not load file or assembly 'Microsoft.IdentityModel.Clients.ActiveDirectory, Version=3.19.5.13701, Culture=neutral, PublicKeyToken=31bf3856ad364e35'.

我班上的using语句如下

The using statements in my class looks as follows

using System;
using Microsoft.Azure.WebJobs;
using Microsoft.Azure.WebJobs.Host;
using Amazon;
using Amazon.S3;
using Amazon.S3.Model;
using System.Threading;
using System.Threading.Tasks;
using Microsoft.Azure.Management.DataLake.Store;
using Microsoft.IdentityModel.Clients.ActiveDirectory;
using Microsoft.Rest.Azure.Authentication;

我找不到发生这种情况的原因,赞赏任何指针

I am unable to find why this is occurring, any pointers appreciated

我的主机的版本如下

Hosting environment: Production
Content root path: C:\Users\MattDouhan\source\repos\NWPimFeeder\NWPimFeeder\bin\Debug\netstandard2.0
Now listening on: http://localhost:7071
Application started. Press Ctrl+C to shut down.
[21/5/2018 8:36:17 AM] Reading host configuration file 'C:\Users\MattDouhan\source\repos\NWPimFeeder\NWPimFeeder\bin\Debug\netstandard2.0\host.json'
[21/5/2018 8:36:17 AM] Host configuration file read:
[21/5/2018 8:36:17 AM] {}
[21/5/2018 8:36:17 AM] Starting Host (HostId=desktop7cks1do-1525525221, InstanceId=8ef074ac-f031-4591-983d-d590041bd1c9, Version=2.0.11651.0, ProcessId=7060, AppDomainId=1, Debug=False, ConsecutiveErrors=0, StartupCount=1, FunctionsExtensionVersion=)

推荐答案

这似乎是由库错误引起的.

It seems caused by library bug.

您可以将Microsoft.IdentityModel.Clients.ActiveDirectory的版本降级为3.14.0.

You could downgrade version of Microsoft.IdentityModel.Clients.ActiveDirectory to 3.14.0.

是一个类似的问题,您可以参考它

This is a similar issue, you could refer to it.

这篇关于Azure Function异常无法加载ActiveDirectory文件或程序集的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆