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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T11:57:47+00:00 2026-05-13T11:57:47+00:00

container.Register( AllTypes.Pick().FromAssembly(typeof (UserRepository).Assembly) .WithService.FirstInterface()); Currently the code above will work fine if the interface

  • 0
    container.Register(
        AllTypes.Pick().FromAssembly(typeof (UserRepository).Assembly)
            .WithService.FirstInterface());

Currently the code above will work fine if the interface are also in the same assembly but it will blow up if IUserRepository is from a different assembly.

Is auto registration from two different assemblies possible? Am I missing something here?

  • 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-13T11:57:47+00:00Added an answer on May 13, 2026 at 11:57 am

    Yes, it’s possible to define auto-registration where the interface is defined in a different assembly. We do it, although we use a slightly different syntax:

    container.Register(AllTypes
        .FromAssemblyContaining<ConfigurationService>()
        .Where(t => t.Name.EndsWith("Service", StringComparison.Ordinal))
        .WithService
        .FirstInterface()
        .Configure(reg => reg.LifeStyle.PerWebRequest));
    

    I can’t say if the different API usage makes a difference, but I would assume that it doesn’t. Rather, I would guess that the cause of the error you experience is that perhaps the assembly containing the interface isn’t available.

    Check if Fusion can load the type from that application at all.

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

Sidebar

Related Questions

Given the following code: container.Register( AllTypes.FromAssemblyNamed(MyNameSpace) .Where(component => component.Name.EndsWith(Repository)) .WithService.FirstInterface() .Configure(component => component.LifeStyle.Singleton) );
When using auto-registration with castle windsor I see people doing things like _container.Register( AllTypes.Pick().FromAssembly(Assembly.GetExecutingAssembly())
I would like to convert this fluent approach to xml: container.Register( AllTypes.FromAssemblyNamed(Company.DataAccess) .BasedOn(typeof(IReadDao<>)).WithService.FromInterface(), AllTypes.FromAssemblyNamed(Framework.DataAccess.NHibernateProvider)
My EAX register contains the xxxxxx9D value and I have the following assembly code:
This registration works when all the implementations of IService are public: AllTypes .Of<IService>() .FromAssembly(GetType().Assembly)
If I have defined in config: container.Register( Component.For<X.Y.Z.IActivityService>() .ImplementedBy<X.Y.Z.ActivityService>() .ServiceOverrides(ServiceOverride.ForKey(Listeners).Eq(new [] { typeof(X.Y.Z.DefaultActivityListener).FullName }))
I have the following registration: container.Register(AllTypes.FromAssemblyContaining<ITabViewModel>().BasedOn<ITabViewModel>()); Two classes: public class StructureDecorationViewModel : NotificationObject, ITabViewModel
I register my two interfaces on application start as so:- container.Register(Component.For(typeof(IEntityIndexController)).ImplementedBy(typeof(SnippetController)).LifeStyle.Transient); container.Register(Component.For(typeof(ISnippetController)).ImplementedBy(typeof(SnippetController)).LifeStyle.Transient); Then when
Given the following registrations builder.Register<A>().As<I>(); builder.Register<B>().As<I>(); builder.Register<C>().As<I>(); var container = builder.Build(); I am looking
I am using the following code for register: builder.RegisterType<QCatVCardParser>().Named<IQCatParser>(.VCF); builder.RegisterType<QCatVCardParser>().Named<IQCatParser>(.VCARD); builder.RegisterType<QCatOutlookMessageParser>().Named<IQCatParser>(.MSG); builder.RegisterType<QCatMimeMessageParser>().Named<IQCatParser>(.EML); builder.RegisterType<QCatCalendarParser>().Named<IQCatParser>(.ICS); container

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.