Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6091401
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T12:19:23+00:00 2026-05-23T12:19:23+00:00

My application sould check its settings at startup and only then start. I’m trying

  • 0

My application sould check its settings at startup and only then start.
I’m trying to figure out how to deal with it using DI container. On one hand I don’t want to put this self-check into composition root. On the other hand if this check fails then we don’t need to register all types with DI container and may simply exit.

So I think of some 2-phase DI. At the first stage only types required during self-check are registered and at the second stage the whole set of types is registered and application object resolved and started. But I don’t see how it can be done.

How would you deal with such a situation? I’m using Autofac.

Thanks.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T12:19:24+00:00Added an answer on May 23, 2026 at 12:19 pm

    For a two phase approach, you could initially build the container with the core application components. You would then resolve these and run your checks. If the checks pass, you could then update the container with the reflected plugins by using the Update container method.

    However, do you need DI for your settings validation types? Why not just use them directly before you build the container?

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to start unit testing on my application (should have done so from
It may sound strange, but in my PHP application I need to check if
My application should load some data when it start at first time, but it
Currently we have many applications, where each application has its own error notification and
I'm developing a multi-user application which uses a (postgresql-)database to store its data. I
I am writing an PHP application and using the gettext module to translate to
I'm trying to implement this (Configuring Sockets for VoIP Usage) using this (CocoaAsyncSocket). To
OK, so I wrote an app using CodeIgniter 1.7.3 and everything was dandy. then
i am validating user input in my application using Struts2 build in validation framework
I'm building an application that will distribute its processing over a farm. In my

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.