我正在使用ASP.NET网站,其目标框架是.NET 4.5。我试图安装最新版本的Sustainsys.Saml2.HttpModule(2.2.0)/Sustainsys.Saml2(2.2.0),但是由于定位framework.NET 4.5而显示安装错误。之后,我使用块块安装了Sustainsys.Saml2.HttpModule(1.0.0)和Sustainsys.Saml2(1.0.0)。它在本地正常工作,但是在服务器上部署后,显示异常。错误附在这里。
Sequence contains no matching element 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.InvalidOperationException: Sequence contains no matching element 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: [InvalidOperationException: Sequence contains no matching element] System.Linq.Enumerable.Single(IEnumerable`1 source, Func`2 predicate) +4014366 Sustainsys.Saml2.IdentityProvider..ctor(IdentityProviderElement config, SPOptions spOptions) +601 Sustainsys.Saml2.Configuration.IdentityProviderCollection.RegisterIdentityProviders(IOptions options) +151 Sustainsys.Saml2.Configuration.Options.LoadOptionsFromConfiguration() +286 System.Lazy`1.CreateValue() +14337348 System.Lazy`1.LazyInitValue() +524 Sustainsys.Saml2.Configuration.Options.get_FromConfiguration() +114 Sustainsys.Saml2.HttpModule.Saml2AuthenticationModule..cctor() +9 [TypeInitializationException: The type initializer for 'Sustainsys.Saml2.HttpModule.Saml2AuthenticationModule' threw an exception.] Sustainsys.Saml2.HttpModule.Saml2AuthenticationModule.OnAuthenticateRequest(Object sender, EventArgs e) +188 System.Web.SyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +92 System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +165 --------------------------------------------------------------------------------