2016-04-18 5 views
0

Ich habe 'SessionAuthenticationModule' basierend auf den Anweisungen von http://www.wiktorzychla.com/2014/11/forms-authentication-revisited-for-net.html konfiguriert. Meine Anwendung ist in .Net 3.5, also änderte ich die Bibliothekszuordnungen basierend auf "Namespace Mapping zwischen WIF 3.5 und WIF 4.5". Wenn ich es ausführe, wirft es die unten gezeigte Ausnahme aus. "InitializePropertiesFromConfiguration (String serviceName) NullReferenceException

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 

" Wichtige Konfigurationseinstellungen finden Sie weiter unten.

<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> 

Alles falsch mit meinen Konfigurationen? Bitte hilf mir.

Antwort

0

Sie scheinen die SAM in web.config zu fehlen.

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

einen Blick auf meine alten Tutorial nehmen, die auf .NET 3,5

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

will
+0

Muss ich "Windows Identity Foundation" von https://www.microsoft.com/en installieren -us/download/details.aspx? id = 17331 in meinem Rechner, um die Website zu betreiben? Ich bin mit dem Laufzeitfehler konfrontiert: "Der Wert der Eigenschaft 'Typ' kann nicht analysiert werden. Der Fehler lautet: Datei oder Assembly konnte nicht geladen werden" Microsoft.IdentityModel.Extensions, Version = 2.0.0.0, Culture = neutral, PublicKeyToken = 69c3241e6f0468ca 'oder einer seiner Abhängigkeiten. Das System kann die angegebene Datei nicht finden. (E: \ ADFS_Test \ web.config Zeile 44) " –

+0

' Microsoft.IdentityModel.Extensions 'ist bereits in der Anwendung referenziert und der Referenztyp stammt von GAC –

+0

Ja, Sie müssen die WIF 3.5 installieren, wenn Sie .net 3.5 zielen. –

Verwandte Themen