1

I'm trying to use dependency injection with the Helix project structure for a sitecore 8.1 project, but I'm having an issue resolving the correct dependencies.

The code has been copied from the Helix project from Git Hub and all project references are from Nuget. I've copied the packages.config to ensure I have the correct version of the packages and have changed the .NET version of the project to 4.6

Can anyone point me in the right direction, please?

namespace Sitecore.Foundation.DependencyInjection.Infrastructure
{
    using Microsoft.Extensions.DependencyInjection; <-- WILL NOT RESOLVE
    using Sitecore.DependencyInjection;

    public class MvcControllerServicesConfigurator : IServicesConfigurator <-WILL NOT RESOLVE
    {
        public void Configure(IServiceCollection serviceCollection)
        {
          //Register interfaces here
        }
    }
}
1

Sitecore's dependency injection was introduced in Sitecore 8.2. It appears you are using 8.1.

  • This does not provide an answer to the question. To critique or request clarification from an author, leave a comment below their post. - From Review – Gatogordo Sep 14 '17 at 7:34
  • 1
    While short, I disagree @Gatogordo. The answer identified the core problem in OP and explained why it does not work as OP expected. Generally we do indeed look for longer answers but it's relatively simple here - feature does not exist in the version you are using. – Mark Cassidy Sep 15 '17 at 6:48
  • True.. I just flagged as too short, but should have written a (better) custom comment. – Gatogordo Sep 15 '17 at 7:14

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.