注销 Web 应用程序时出现 System.ArgumentException 异常

症状

当您注销由多个身份验证提供程序配置的 SharePoint 2013 Web 应用程序 (例如 Windows 声明和 FBA 声明身份验证提供程序) 时,异常页面上会显示以下调用堆栈异常消息:

Exception of type 'System.ArgumentException' was thrown. Parameter name: encodedValue at  
Microsoft.SharePoint.Administration.Claims.SPClaimEncodingManager.DecodeClaimFromFormsSuffix(System.String)  
Microsoft.SharePoint.Administration.Claims.SPClaimProviderManager.GetProviderUserKey(Microsoft.IdentityModel.Claims.IClaimsIdentity, System.String)  
Microsoft.SharePoint.Administration.Claims.SPClaimProviderManager.GetProviderUserKey(System.String)  
Microsoft.SharePoint.Utilities.SPUtility.GetFullUserKeyFromLoginName(System.String)  
Microsoft.SharePoint.ApplicationRuntime.SPHeaderManager.AddIsapiHeaders(System.Web.HttpContext, System.String, System.Collections.Specialized.NameValueCollection)  
Microsoft.SharePoint.ApplicationRuntime.SPRequestModule.PreRequestExecuteAppHandler(System.Object, System.EventArgs)  

原因

出现此问题的原因是 IIS 缓存中留下了无效的用户上下文。

解决方案

若要解决此问题,请按照以下步骤将“ 注销 ”链接替换为 SharePoint 场上所有 Web 前端服务器的 “以不同用户身份登录 ”链接:

  1. 在以下文件夹中,在文本编辑器(如记事本)中打开 welcome.ascx 文件:

    C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\15\TEMPLATE\CONTROLTEMPLATES
    
  2. 将旧文本替换为新文本,如下所示:
    旧文本

    <SharePoint:MenuItemTemplate runat="server" id="ID_Logout"  
    Text="<%$Resources:wss,personalactions_logout%>"  
    Description="<%$Resources:wss,personalactions_logoutdescription%>"  
    MenuGroupId="100"  
    Sequence="400"  
    UseShortId="true"  
    />  
    

    新文本

    <SharePoint:MenuItemTemplate runat="server" ID="ID_LoginAsDifferentUser"  
    Text="<%$Resources:wss,personalactions_loginasdifferentuser%>"   
    Description="<%$Resources:wss,personalactions_loginasdifferentuserdescription%>"   
    MenuGroupId="100"   
    Sequence="400"   
    UseShortId="true"   
    />  
    

    注意 将更改文本和说明属性,以模拟注销按钮。

更多信息

仍然需要帮助? 请转到 SharePoint 社区