InitializePropertiesFromConfiguration(字符串服务名)的NullReferenceException [英] InitializePropertiesFromConfiguration(String serviceName) NullReferenceException

查看:413
本文介绍了InitializePropertiesFromConfiguration(字符串服务名)的NullReferenceException的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经配置的基础上,从的 http://www.wiktorzychla.com/2014/11/forms-authentication-revisited-for-net.html 。我的应用程序是在.net 3.5,所以我改变WIF 3.5和4.5 WIF之间的命名空间映射的基础上库映射。当我运行它,它抛出如下所示的异常。

I have configured 'SessionAuthenticationModule' based on the instructions from http://www.wiktorzychla.com/2014/11/forms-authentication-revisited-for-net.html. My application is in .Net 3.5 so I changed the library mappings based on "Namespace Mapping between WIF 3.5 and WIF 4.5". When I run it, it is throwing the exception shown below. "

Object reference not set to an instance of an object. 
  Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. 

 Exception Details: System.NullReferenceException: Object reference not set to an instance of an object.

Source Error: 


 An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.  

Stack Trace: 

[NullReferenceException: Object reference not set to an instance of an object.]
   Microsoft.IdentityModel.Web.SessionAuthenticationModule.InitializePropertiesFromConfiguration(String serviceName) +16
   Microsoft.IdentityModel.Web.SessionAuthenticationModule.InitializeModule(HttpApplication context) +124
   Microsoft.IdentityModel.Web.HttpModuleBase.Init(HttpApplication context) +30


主要配置设置如下所示。

" Major configuration settings are shown below.

<section name="Microsoft.IdentityModel" type="Microsoft.IdentityModel.Configuration.SystemIdentityModelSection, Microsoft.IdentityModel"/>
    <section name="Microsoft.IdentityModel.Protocols" type="Microsoft.IdentityModel.Web.Configuration.SystemIdentityModelServicesSection, Microsoft.IdentityModel.Protocols.WSFederation"/>
  </configSections>




<Microsoft.IdentityModel></Microsoft.IdentityModel>

<Microsoft.IdentityModel.Protocols>    
    <federationConfiguration>
      <cookieHandler requireSsl="false"/>
    </federationConfiguration>
  </Microsoft.IdentityModel.Protocols>

什么不对我的配置?请帮我。

Anything wrong with my configurations? Please help me.

推荐答案

您似乎缺少了SAM在的web.config

You seem to lack the SAM in web.config.

  <httpModules>
         <add name="SessionAuthenticationModule" 
              type="Microsoft.IdentityModel.Web.SessionAuthenticationModule, Microsoft.IdentityModel, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
  </httpModules>

看看我的老教程,旨在.NET 3.5

Take a look at my old tutorial that aims at .NET 3.5

http://www.wiktorzychla.com/2011/08/quest-for-customizing-adfs-sign-ing-web.html

这篇关于InitializePropertiesFromConfiguration(字符串服务名)的NullReferenceException的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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