C# Can';t加载Microsoft.Data.Services.Client异常
我有一个MVC站点作为云服务托管在Azure中。用户使用这些AD帐户通过单点登录登录 在chrome中,这很好,但当我通过IE访问该网站时,我得到以下信息C# Can';t加载Microsoft.Data.Services.Client异常,c#,azure,azure-active-directory,C#,Azure,Azure Active Directory,我有一个MVC站点作为云服务托管在Azure中。用户使用这些AD帐户通过单点登录登录 在chrome中,这很好,但当我通过IE访问该网站时,我得到以下信息 Could not load file or assembly 'Microsoft.Data.Services.Client, Version=5.6.4.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The system c
Could not load file or assembly 'Microsoft.Data.Services.Client, Version=5.6.4.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The system cannot find the file specified.
我不明白为什么相同的服务器端代码在不同的浏览器中有不同的结果
当我重写System.Security.Claims.ClaimsAuthenticationManager中的Authenticate方法时,错误似乎发生在中
我们这样做是为了检查用户是否具有特定的AD角色,如果是,则只需调用base.Authenticate,这就是引发异常的地方
堆栈跟踪:
[FileNotFoundException: Could not load file or assembly 'Microsoft.Data.Services.Client, Version=5.6.4.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The system cannot find the file specified.]
...GraphClaimsAuthenticationManager.Authenticate(String resourceName, ClaimsPrincipal incomingPrincipal) in ...Azure.Helpers\GraphClaimsAuthenticationManager.cs:76
System.IdentityModel.Services.WSFederationAuthenticationModule.SignInWithResponseMessage(HttpRequestBase request) +694
System.IdentityModel.Services.WSFederationAuthenticationModule.OnAuthenticateRequest(Object sender, EventArgs args) +103571
System.Web.SyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +92
System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +165
更新
我想我已经部分解决了,Dll没有被构建到Azure云服务包中。Copy Local设置为true,并且在本地构建时获得输出。但不确定为什么未包含此dll。如果项目使用此dll,请确保已部署
Microsoft.Data.Services.Client
dll
根据我的理解,重写
ClaimsAuthenticationManager.Authenticate
不需要此dll。并且此错误是服务器端问题,浏览器不会导致此问题,请确保您使用不同的web浏览器访问相同的应用 你能提供异常堆栈吗?你的第一句话帮助了费雪,现在只是想弄清楚为什么没有部署它。