Skip to main content

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.

18 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
5 votes
0 answers
2k 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 ...
Rondel's user avatar
  • 493
4 votes
0 answers
259 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 ...
sandip patel's user avatar
3 votes
0 answers
367 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:...
Commerce Test's user avatar
2 votes
0 answers
193 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 ...
andyp's user avatar
  • 903
2 votes
1 answer
238 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 ...
Mkress's user avatar
  • 103
1 vote
0 answers
48 views

Error in Personalize / Experience component computed index field

I am testing an upgraded site (9.0.2 to 10.3.1). I see the following new errors in the Sitecore logs when republishing the 10.3.1 site: 36148 14:13:02 ERROR [Content Testing]: Error in Experience ...
Marcel Gruber's user avatar
1 vote
2 answers
262 views

Autofac DI with Sitecore 10.3

We are currently doing sitecore upgrade and but there are something broken with autofac DI integration with sitecore. we created our own serviceProviderBuilder which extends Sitecore....
Ting Wang's user avatar
1 vote
0 answers
4k views

An error occurred when trying to create a controller of type 'MapController'. Make sure that the controller has a parameterless public constructor

I'm working on an upgrade from Sitecore 8.2 to 10.1, and I've got some API Controllers. These worked in the 8.2 site but I'm encountering dependency injection issues now, getting the following error ...
Erica Stockwell-Alpert's user avatar
1 vote
0 answers
77 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 ...
Rajesh Kumar's user avatar
1 vote
0 answers
371 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 ...
Surbhi Kochhar's user avatar
1 vote
1 answer
2k 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 ...
MikeD's user avatar
  • 880
1 vote
2 answers
910 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? ...
squadwuschel's user avatar
  • 1,175
1 vote
0 answers
742 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 ...
melvin's user avatar
  • 11
0 votes
0 answers
136 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 ...
Ethan Schofer's user avatar
0 votes
0 answers
555 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....
Debaparna's user avatar
  • 507
0 votes
0 answers
2k 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 ...
Sharad Kumar Sangal's user avatar
0 votes
0 answers
234 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 ...
Meenakshi's user avatar
  • 235
0 votes
0 answers
425 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 ...
Adam Hess's user avatar
  • 364