1

我正在尝试反编译System.IdentityModel.Services.dll,但没有一个反编译工具显示方法详细信息

我什至无法在 ILDASM 中获得这些方法的 IL。ILSpy 也是如此。

例如: System.IdentityModel.Services.SessionAuthenticationModule

伊尔达斯姆:

.method family hidebysig newslot virtual 
        instance void  OnAuthenticateRequest(object sender,
                                             class [mscorlib]System.EventArgs eventArgs) cil managed
{
  // Code size       0 (0x0)
} // end of method SessionAuthenticationModule::OnAuthenticateRequest


.method family hidebysig instance class [mscorlib]System.Collections.ObjectModel.ReadOnlyCollection`1<class [mscorlib]System.Security.Claims.ClaimsIdentity> 
        ValidateSessionToken(class [System.IdentityModel]System.IdentityModel.Tokens.SessionSecurityToken sessionSecurityToken) cil managed
{
  // Code size       0 (0x0)
} // end of method SessionAuthenticationModule::ValidateSessionToken

我原以为至少 IL 总是可用的。不是这样吗?

4

1 回答 1

0

r# 能够找到 microsoft 参考源,Reflector 能够生成:

    protected ReadOnlyCollection<ClaimsIdentity> ValidateSessionToken(SessionSecurityToken sessionSecurityToken)
{
    ReadOnlyCollection<ClaimsIdentity> onlys;
    SessionSecurityTokenHandler handler = base.FederationConfiguration.IdentityConfiguration.SecurityTokenHandlers[typeof(SessionSecurityToken)] as SessionSecurityTokenHandler;
    if (handler == null)
    {
        throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new InvalidOperationException(SR.GetString("ID4011", new object[] { typeof(SessionSecurityToken) })));
    }
    try
    {
        onlys = new ReadOnlyCollection<ClaimsIdentity>(handler.ValidateToken(sessionSecurityToken, this.CookieHandler.Path));
    }
    catch (SecurityTokenExpiredException exception)
    {
        throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new FederatedSessionExpiredException(DateTime.UtcNow, sessionSecurityToken.ValidTo, exception));
    }
    catch (SecurityTokenNotYetValidException exception2)
    {
        throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new FederationException(SR.GetString("ID1071", new object[] { DateTime.UtcNow, sessionSecurityToken.ValidFrom }), exception2));
    }
    return onlys;
}

ILSpy 正在生成非常相似的代码。所以我猜您正在查看错误的组件或缺少其他内容。

于 2014-06-09T21:54:53.913 回答