Questions tagged [dependency-injection]

Anything related to the use of Dependency Injection (DI)/IoC containers on a Sitecore solution. This also includes the baked-in Microsoft Dependency Resolver included natively in Sitecore versions 8.2 and above.

16 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
5
votes
0answers
1k views

Ninject activation exception on publish: ILogManager

I started getting a strange error on publish in one our our dev sitecore instances that seems to be coming from some Sitecore.Social.Client piplines. Exception[1]: Ninject.ActivationException ...
4
votes
0answers
214 views

After replacing default DI container Sitecore 8.2 Sitecore ItemService and EntityService stop working

Thanks to Dmytro Shevchenko http://structuredcode.com/replacing-default-di-container-sitecore-8-2/ We are replacing default DI Container with Windsor Castle. All project works perfectly fine, except ...
2
votes
0answers
116 views

How to implement DI service configurator in Automation Engine service registration

I am seeking to inject a service with dependencies into a Marketing Automation Activity Type that will be instantiated by the Marketing Automation Engine. I have successfully injected a basic service ...
2
votes
0answers
293 views

How to inject dependencies in solution that extends Sitecore Reference Storefront

I patched the Initialize Pipeline InitializeControllerFactory processor to point to my new solution InitializeControllerProcessor via: <?xml version="1.0"?> <configuration xmlns:patch="http:/...
1
vote
0answers
37 views

Error on dragging a form element when using Ninject

I am getting below error when I drag a form element on form designer. I think it is because of dependency injection. I am using ninject DI in my application. Looking for help how to handle ...
1
vote
0answers
249 views

MVC Layout model is empty after Glass Mapper Upgrade

We recently upgraded from Sitecore 8.2.0 to Sitecore 9.2.0. Along with other packages, we also upgraded to the latest compatible version of Glass Mapper 5 for Sitecore 9.2.0. We use Simple Injector ...
1
vote
0answers
606 views

Sitecore 9 Forms - SimpleInjector conflicting with FormBuilderController

Sitecore 9.0.1 (rev. 171219) SimpleInjector v.4.3.0 Glass.Mapper v.4.5.0.4 Steps To Reproduce: In the Sitecore dashboard I click on the Forms button Click the Create button and select Blank Form On ...
1
vote
1answer
86 views

Extend /sitecore/api/ssc/EXM/Message with additional data

I want to extend /sitecore/api/ssc/EXM/Message endpoint with additional data. I added a new class namespace Exm.Extended { [ServicesController("EXM.Message")] public class ...
0
votes
0answers
52 views

Dependency Injection - Get current Language

I am trying to make full use of Dependency Injection with Sitecore 9.3. The hardest part is getting away from using Sitecore.Context. I've been looking at ShowServicesConfig.aspx to try and find what ...
0
votes
0answers
238 views

Error when trying to Create a new form using Sitecore 9

On clicking Create new in Sitecore Form getting the below error: Message: /formbuilder/load?id=&sc_formmode=new&sc_formlang=en&sc_site=shell&_=1597294914778StackTrace: at Autofac....
0
votes
0answers
1k views

Autofac.Core.DependencyResolutionException Sitecore 9.2

I am getting below error in the logs, when I am overriding Sitecore Dependency Injection with Autofac DI. I am using Sitecore 9.2. The main issue is with Create Actions on EXM & Forms. Can ...
0
votes
1answer
961 views

Unable to resolve service for type 'System.Collections.Generic.IList`1[Client.Feature.Membership.Services.FacetUpdaters.IContactFacetUpdater]'

I'm trying to replicate the federated auth from habitat using the Facebook example, and parlay that into auth with Salesforce. I can't get around this dependency injection error though. Starting with ...
0
votes
1answer
335 views

Publishing service 404

XHR requests in my publishing service are returning 404 with messages that resource could not be found: { "Message": "No HTTP resource was found that matches the request URI 'http://...
0
votes
0answers
178 views

Dependency injection container issue SXA

I've recently upgraded the Sitecore 8.2 solution to Sitecore 9.1 update 1 which works fine. But I also have to convert the existing site to SXA site. So, I started by adding the fresh SXA site but ...
0
votes
1answer
544 views

Custom Dependency Injection for Sitecore pipeline processor with Ninject

I've implemented a custom Resolver for my Controllers for Ninject which works fine, however this is not working for pipelines. How can I create a custom dependency Injection for Sitecore pipelines? ...
0
votes
0answers
255 views

Sitecore.Context.Item added to Dependency Injection not working when needed by secodary DI'ed class

I need to get the context item to create a "SearchContext" in my repository class using the following configurator : public class DependencyInjectionConfigurator : IServicesConfigurator { public ...