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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T00:31:41+00:00 2026-05-14T00:31:41+00:00

I want to implement multi tenancy using Windsor and i don’t know how to

  • 0

I want to implement multi tenancy using Windsor and i don’t know how to handle this situation:

i succesfully used this technique in plain ASP.NET MVC projects and thought incorporating in a RIA Services project would be similar.

So i used IHandlerSelector, registered some components and wrote an ASP.NET MVC view to verify it works in a plain ASP.NET MVC environment. And it did!

Next step was to create a DomainService which got an IRepository injected in the constructor. This service is hosted in the ASP.NET MVC application. And it actually … works:i can get data out of it to a Silverlight application.

Sample snippet:

public OrganizationDomainService(IRepository<Culture> cultureRepository)
{
            this.cultureRepository = cultureRepository;
}

Last step is to see if it works multi-tenant-like: it does not! The weird thing is this:
using some line of code and writing debug messages in a log file i verified that the correct handler is selected! BUT this handler seems not to be injected in the DomainService. I ALWAYS get the first handler (that’s the logic in my SelectHandler)

Can anybody verify this behavior? Is injection not working in RIA Services? Or am i missing something basic??

Development environment: Visual Studio 2010 Beta2

Thanks in advance

  • 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-14T00:31:41+00:00Added an answer on May 14, 2026 at 12:31 am

    So it seems i did a very weird thing in my OrganizationDomainServiceFactory.
    The code which did NOT work is this:

    public DomainService CreateDomainService(Type domainServiceType, DomainServiceContext context  )
    {
    WindsorContainer container = new WindsorContainer(new XmlInterpreter(new ConfigResource("castle")));
    IRepository<Culture> cultureRepository = container.Resolve<IRepository<Culture>>();
    IRepository<Currency> currencyRepository = container.Resolve<IRepository<Currency>>();
    
    DomainService ds = (DomainService)Activator.CreateInstance(domainServiceType, new object[] { cultureRepository,currencyRepository });
    
    ds.Initialize(context);
    return ds;
    }
    

    This is apparently not working, because of the creation of a new Container (which should not take place).

    OK! So i thought i try to use ServiceLocator to get a reference to the Windsor Container (used in the WindsorControllerFactory – that’s how i call it … in the boot up of the ASP.NET MVC application), and changed the code to this:

    public DomainService CreateDomainService(Type domainServiceType, DomainServiceContext context  )
    {
    IRepository<Culture> cultureRepository = ServiceLocator.Current.GetInstance<IRepository<Culture>>();
    IRepository<Currency> currencyRepository = ServiceLocator.Current.GetInstance<IRepository<Currency>>();
    
    DomainService ds = (DomainService)Activator.CreateInstance(domainServiceType, new object[] { cultureRepository,currencyRepository });
    
    ds.Initialize(context);
    return ds;
    }
    

    and guess what: it works(!!!) multi-tenancy as it should be!

    The only thing i don’t know is: is there another way to “inject” the container (constructor injection seems not to work here , the compiler complains)

    BTW: moved the project from VS2010Beta2 to VS2010RC (with RIA Services support), but this should not affect the outcome!

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

Sidebar

Related Questions

I want to implement multi language in my site using zend framework. I need
i starter in jqgrid, i want implement inline edit in jqgrid i have this
given this class definition: public class Frame { IFrameStream CapturedFrom; } I want implement
I am still learning .NET framework and I want to implement multi-tier application just
I want to implement a multi file upload I was thinking if its possible
The well known Command pattern is used often when you want to implement a
I am new to multi-thread programming, I want to implement the following functionality. There
I'm currently making a site where i want to implement multi-language version. which actually
I'm trying to implement a workaround to the problem of using AJAX with multi-part
I have a multi-step Rails 3 form that I set up using this railscast:

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.