Skip to content
This repository has been archived by the owner on Sep 18, 2021. It is now read-only.

Inheriting from DefaultViewService - Cannot resolve DefaultViewServiceOptions #3033

Closed
1 task done
jjwilliams42 opened this issue Jul 1, 2016 · 1 comment
Closed
1 task done

Comments

@jjwilliams42
Copy link

jjwilliams42 commented Jul 1, 2016

  • I read and understood how to enable logging

Question / Issue

Based off of this question:

#2124

I tried inheriting from DefaultViewService, however it can never instantiate my CustomViewService.

Relevant code:

public class IdentityServerViewService : DefaultViewService
    {
        public IdentityServerViewService(DefaultViewServiceOptions config, IViewLoader viewLoader) : base(config, viewLoader)
        {
        }
}

Registration:
factory.ConfigureDefaultViewService(new DefaultViewServiceOptions());
factory.ViewService = new Registration<IViewService, IdentityServerViewService>();

Relevant parts of the log file

None of the constructors found with 'Autofac.Core.Activators.Reflection.DefaultConstructorFinder' on type 'APP.Bootstrapper.IdentityServer.IdentityServerViewService' can be invoked with the available services and parameters: Cannot resolve parameter 'IdentityServer3.Core.Services.Default.DefaultViewServiceOptions config' of constructor 'Void .ctor(IdentityServer3.Core.Services.Default.DefaultViewServiceOptions, IdentityServer3.Core.Services.Default.IViewLoader)'."
@jjwilliams42
Copy link
Author

Figured it out, for anyone else having this issue here is the registration line:

factory.ViewService = new DefaultViewServiceRegistration<IdentityServerViewService>();

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant