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 42969
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 10, 20262026-05-10T15:25:16+00:00 2026-05-10T15:25:16+00:00

From what I’ve read about Windsor/Microkernel it is in theory possible to do everything

  • 0

From what I’ve read about Windsor/Microkernel it is in theory possible to do everything that you can do using xml files with code. As a matter of fact – and please correct me if I’m wrong – it seems like the major contribution of the Windsor layer is to add xml configuration for things Microkernel can already do.

However, I have been struggling lately with finding out how to implement some slightly more complicated functionality in code though (ie. how to assign a default constructor argument value). Now while I am going to use xml in my production release, I am registering components in code for my tests and this is getting to be quite problematic. This is not helped by the unfortunate state of their documentation and the fact that the only articles I can find focus on xml registration.

Does anybody know a source which lists how to register things in code (preferably with the xml equivalent)? Baring the existence of that, does anyone simply know of an open source/sample project where there is significant non-xml use of Castle Windsor/Microkernel?

  • 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-10T15:25:17+00:00Added an answer on May 10, 2026 at 3:25 pm

    I’ve always found looking at the unit test the best way to learn how to use an open source project. Castle has a fluent interface that will allow you to do everything in code. From the WindsorDotNet2Tests test case:

    [Test]     public void ParentResolverIntercetorShouldNotAffectGenericComponentInterceptor()     {         WindsorContainer container = new WindsorContainer();         container.AddComponent<MyInterceptor>();          container.Register(             Component.For<ISpecification>()                 .ImplementedBy<MySpecification>()                 .Interceptors(new InterceptorReference(typeof(MyInterceptor)))                 .Anywhere             );         container.AddComponent('repos', typeof(IRepository<>), typeof(TransientRepository<>));          ISpecification specification = container.Resolve<ISpecification>();         bool isProxy = specification.Repository.GetType().FullName.Contains('Proxy');         Assert.IsFalse(isProxy);     } 

    And for more, check out the the ComponentRegistrationTestCase and AllTypesTestCase

    There is also a DSL for doing it, this is my prefered option, as it really simplifies things and offers alot of easy extensibility. The DSL is called Binsor, which you can read more about here: http://www.ayende.com/Blog/archive/7268.aspx But again, the best place for infor is the Unit Tests. This is a code example of whats possible with binsor:

    for type in AllTypesBased of IController('Company.Web.Controller'):     component type 

    Those two lines will register ever type that inherits the IController interface into the container 😀

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

Sidebar

Ask A Question

Stats

  • Questions 57k
  • Answers 58k
  • 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 The SQL Server Management Studio Tool can do it. Attach… May 11, 2026 at 8:33 am
  • added an answer You have a couple of options, based on your requirements.… May 11, 2026 at 8:33 am
  • added an answer I think that Castle Dynamic Proxy is the solution of… May 11, 2026 at 8:33 am

Top Members

Trending Tags

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

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.