Giter Club home page Giter Club logo

Comments (3)

dotnetjunkie avatar dotnetjunkie commented on June 25, 2024

The Simple Injector container is not the .NET Core built-in container and different advice applies here.

During the ConfigureServices phase, registrations are made into the built-in configuration system (the built-in container), and during this time you can as well make the registrations for Simple Injector. During this time however, the built-in configuration system is built and framework services can't be resolved yet from the system. It's only during the Configure phase that services can be resolved from the ASP.NET configuration system.

Resolving types from the built-in configuration system is often needed, because your application needs to interact with framework supplied components. This will typically mean that you create adapters for application-specific abstractions and the adapter will internally callback into framework components. Since those framework components can only be resolved during the Configure phase, it's not possible to register those adapters into Simple Injector before the Configure phase.

So yes, you can move most of your registrations to ConfigureServices. Where to place them is completely up to you, but you will at least have your adapter registrations in the Configure phase.

from documentation.

dotnetjunkie avatar dotnetjunkie commented on June 25, 2024

This question is better suited on https://github.com/simpleinjector/SimpleInjector/issues/ instead.

from documentation.

YehudahA avatar YehudahA commented on June 25, 2024

@dotnetjunkie, Thank you very much!

from documentation.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.