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
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
...
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 ...
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:...
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 ...
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 ...
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 ...
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....
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 ...
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 ...
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 ...
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 ...
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?
...
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 ...
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 ...
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....
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 ...
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 ...
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 ...