Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Yogeshwer Sharma 10 posts 80 karma points
    Aug 09, 2024 @ 11:25
    Yogeshwer Sharma
    0

    Unable to resolve type: Umbraco.Core.Composing.ComponentCollection, service name:

    Hi Team,

    I am using Umbraco 8.18.12

    I am working on a plugin and stuck with issue where I need to register dependency for my custom class into StartUp file.

    I am trying as below -

    public class NewLandStartup : IUserComposer {
    public void Compose(Composition composition) { composition.Components().Append

        public class StartupComponent : IComponent
        {
            private readonly IDatabaseProvider dbProvider;
            public StartupComponent(IDatabaseProvider dbProvider)
            {
                this.dbProvider = dbProvider;
            }
    

    And I also created new class which has

    public class RegisterDependencies : IUserComposer { public void Compose(Composition composition) { composition.Register

    Anyone know what I am doing wrong or is there any other method for same ?

    Error I am getting is

    : Unable to resolve type: Umbraco.Core.Composing.ComponentCollection, service name: at LightInject.ServiceContainer.CreateDelegate(Type serviceType, String serviceName, Boolean throwError) in C:\projects\lightinject\src\LightInject\LightInject.cs:line 4748

    Any help would be appreciated!!!

  • Yogeshwer Sharma 10 posts 80 karma points
    Aug 12, 2024 @ 08:13
    Yogeshwer Sharma
    0

    Any help on above ? Actually I am struggling to register the dependency. So for example in my case I have a class -

    DBProvider and using MigrationBase to get the custom tables in Umbraco DB. I think it is uses IMigrationContext which is causing issues for dependency. So any help with DI would be appreciated.

Please Sign in or register to post replies

Write your reply to:

Draft