0

I have app service ExperienceAppService that implements interface IExperienceAppService.

I try to use Scrutoк for auto registering

I have this code in Startup file

 services.Scan(scan =>
            scan.FromCallingAssembly()
                .AddClasses()
                .AsMatchingInterface());

It supposed to register interface . But I got this error

Unable to resolve service for type 'TooSeeWeb.Core.Interfaces.Experiences.IExperienceAppService' while attempting to activate 'TooSeeWeb.Controllers.ExperienceController'.

Where is my trouble?

Eugene Sukh
  • 2,357
  • 4
  • 42
  • 86
  • The issue i think is that your Interfaces and registered classes are in different assemblies try adding them on the same project. Then everything should work. Also make sure that the Scanner from Scrutor is in the same project as well. I have tried sth similar here with Autofac -> https://stackoverflow.com/questions/59164555/autofac-automate-assembly-scanning-net-core-3-0-register-according-to-lifetim/59236011#59236011. I never managed to do Solution Scanning. – panoskarajohn Jan 21 '20 at 10:25
  • 1
    Yeah, that helps@panoskarajohn – Eugene Sukh Jan 21 '20 at 10:29

0 Answers0