Unable to resolve service for type 'Microsoft.AspNetCore.Http.IHttpContextAccessor' while attempting to activate 'ComponentSpace.Saml2.AspNetCore.AspNetHttpRequest'.

Unable to resolve service for type 'Microsoft.AspNetCore.Http.IHttpContextAccessor' while attempting to activate 'ComponentSpace.Saml2.AspNetCore.AspNetHttpRequest'.

Thoughts on why this is occurring?

Do you happen to be running the application on Azure?
Please contact support@componentspace.com for an update.

[quote]
jstudzinski - 11/22/2017
Unable to resolve service for type 'Microsoft.AspNetCore.Http.IHttpContextAccessor' while attempting to activate 'ComponentSpace.Saml2.AspNetCore.AspNetHttpRequest'.

Thoughts on why this is occurring?
[/quote]

This page:
https://stackoverflow.com/questions/37371264/invalidoperationexception-unable-to-resolve-service-for-type-microsoft-aspnetc
provides a solution:


using Microsoft.AspNetCore.Http;
using Microsoft.Extensions.DependencyInjection.Extensions;

namespace SAMLTest

{

public class Startup

{

public Startup(IConfiguration configuration)

{

Configuration = configuration;

}

public IConfiguration Configuration { get; }

// This method gets called by the runtime. Use this method to add services to the container.

public void ConfigureServices(IServiceCollection services)

{

services.TryAddSingleton();



Thanks Michael.
Version 2.0.3 of the product includes this registration as part of the AddSaml extension method.