【发布时间】:2017-01-19 16:55:37
【问题描述】:
我有一个在 Azure 中托管为云服务的 MVC 站点。用户使用 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 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,当我在本地构建时它会得到输出。不知道为什么不包括在内。
【问题讨论】:
-
能否提供异常堆栈?
标签: c# azure azure-active-directory