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

  • Home
  • SEARCH
  • 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 167147
In Process

The Archive Base Latest Questions

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

I have a class that I want to have access to my IOC container

  • 0

I have a class that I want to have access to my IOC container (Windsor), however I don’t want to keep a static IWindsorContainer property hanging around – I would prefer to have the container inject itself into any classes that require an IWindsorContainer as a constructor dependency.

I’ve pulled this off with Unity, but when I try the same thing with the Windsor container it tells me that IWindsorContainer is not registered with the container.

I don’t think I can just register IWindsorContainer => WindsorContainer, because that will cause the container to create a new (or different) instance of itself to pass to my class, and that instance won’t have all my other types registered with it. I also don’t see a way to construct the container, register all the types in it, and then register that instance of itself against IWindsorContainer – all of the registration methods only take types for service and implementation – never an actual concrete instance.

  • 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. 2026-05-11T12:13:24+00:00Added an answer on May 11, 2026 at 12:13 pm

    Generally you don’t want to inject the container into your application components.

    See these questions (this question is almost a duplicate of them):

    • Usage of IoC Containers; specifically Windsor
    • NInject: Where do you keep your reference to the Kernel?
    • IoC, Where do you put the container?

    BTW: you get IKernel injection for free, and you can register IWindsorContainer:

    container.Register(Component.For<IWindsorContainer>().Instance(container)); 
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 73k
  • Answers 73k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • added an answer LINQ is a query language - not an editing language.… May 11, 2026 at 1:58 pm
  • added an answer Thank you for your answers, I found out the origin… May 11, 2026 at 1:58 pm
  • added an answer Your User Control has width and height predefined, and your… May 11, 2026 at 1:58 pm

Related Questions

I have a class that I want to use to store properties for another
I have a class that i want to push_back into a deque. The problem
I have a pseudo random number generator (PRNG) class that I want to unit
I have a class of type ISimpleCache<IBrokeredDataObject> that I want to add as a
I have a factory class that populates objects with data. I want to implementing
I am curious what strategies folks have found for unit testing a data access
This is a detail question for C#. Suppose I've got a class with an
Okay, this is a bit abstract, but here goes: I'm creating a website and
So if I have a class like: CustomVal I want to be able to

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.