Copied to clipboard

Flag this post as spam?

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


  • Mark Roffey 31 posts 184 karma points
    Dec 29, 2020 @ 14:00
    Mark Roffey
    0

    Using Umbraco Content service in Castle Windsor container in Ucommerce.

    Hi,

    One of the dependencies I'm using for a pipeline task in Ucommerce needs to be injected using the castle Windsor container that they use.

    By injecting the content service, I now need to inject a whole host of additional services.

    I'm trying to register the first one. the UmbracoDatabaseFactory here, but it's not working

    <component id="UmbracoDatabaseFactory"
                   service="Umbraco.Core.Persistence.IUmbracoDatabaseFactory', Umbraco.Core"
                   type="Umbraco.Core.Persistence.UmbracoDatabaseFactory,  Umbraco.Core" />
    

    The service is correct, but the type doesn't appear to match. Is it because the type isn't public? https://github.com/umbraco/Umbraco-CMS/blob/v8/contrib/src/Umbraco.Core/Persistence/UmbracoDatabaseFactory.cs

  • George Draganoiu 1 post 71 karma points
    Jan 05, 2021 @ 09:22
    George Draganoiu
    0

    Hi Mark,

    I have tried to register the component as you did, and I got an error complaining about parameters.

    After adding parameters and restarting the app, the website started up.

    Have you tried adding parameters? It should look something like this:

     <component id="UmbracoDatabaseFactory"
               service="Umbraco.Core.Persistence.IUmbracoDatabaseFactory, Umbraco.Core"
               type="Umbraco.Core.Persistence.UmbracoDatabaseFactory,  Umbraco.Core" >
               <parameters>
               <connectionStringName/>
               <connectionString/>
               <providerName/>
               </parameters>
      </component>
    

    If that does not work, can you expand on the errors you are getting?

Please Sign in or register to post replies

Write your reply to:

Draft