Base solution for your next web application
Ends in:
01 DAYS
01 HRS
01 MIN
01 SEC
Open Closed

ISingletonDependency with new project #6758


User avatar
0
antonis created

I have created a new project for some infrastructure code I have in my solution. I have a helper service there that needs to be singleton.

public class FileProvider : IFileProvider, ISingletonDependency
    {
    }
    
    public interface IFileProviderProvider
    {
        string GetDataFilesPath();
    }

However when I try to use this provider in another service initializing it from the constructror I get

Castle.MicroKernel.ComponentNotFoundException: No component for supporting the service MyProject.Infrastructure.Helpers.IFileProvider was found

Does anyone know why am I getting this?


2 Answer(s)
  • User Avatar
    2
    aaron created
    Support Team

    You need to [DependsOn(...)] the module.

  • User Avatar
    0
    antonis created

    @aaron Thanks