Unable to resolve service for type 'Microsoft.AspNetCore.Http.IHttpContextAccessor' while attempting to activate 'ComponentSpace.Saml2.AspNetCore.AspNetHttpRequest'.
Thoughts on why this is occurring?
Unable to resolve service for type 'Microsoft.AspNetCore.Http.IHttpContextAccessor' while attempting to activate 'ComponentSpace.Saml2.AspNetCore.AspNetHttpRequest'.
Do you happen to be running the application on Azure?
Please contact support@componentspace.com for an update.
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.