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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T16:55:36+00:00 2026-05-29T16:55:36+00:00

I am registering my components/services as shown here and I am also implementing a

  • 0

I am registering my components/services as shown here and I am also implementing a class as shown below. When I call Reload, its saying its not registered and I know it is. Any ideas?

public interface ITypeReloader 
{ 
    PluginBase Reload(Type type); 
} 

public class TypeReloader 
{ 
    IComponentContext _container; 
    public TypeReloader(IComponentContext container) 
    { 
        _container = container; 
    } 

    public PluginBase Reload(Type type) 
    { 
        (PluginBase)_container.Resolve(type);  //Not registered error
    } 
}
  • 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-29T16:55:37+00:00Added an answer on May 29, 2026 at 4:55 pm

    The answer you link to uses AppDomain.CurrentDomain.GetAssemblies() to get the currently loaded assemblies, and then registers any types derived from PluginBase in them.

    However, assemblies are only loaded into an AppDomain when first needed. I bet the types you are interested in reside in assemblies which have not yet been loaded when you do the registration. You can check this by looking the result of AppDomain.CurrentDomain.GetAssemblies(): is it missing any assemblies you were expecting to be there?

    The easiest way to fix this is by using the AutoFac MEF integration and MEF’s DirectoryCatalog instead. The DirectoryCatalog is designed exactly for this scenario.

    edit: on a second look, the problem is that you register as PluginBase but then try to resolve as some subtype. For what you are trying to achieve here, you probably need to register .AsSelf() instead of .As<PluginBase>().

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

Sidebar

Related Questions

Is registering components on castle windsor thread-safe? I.e., can multiple threads simultaneously register components
I am implementing IQueryCancelAutoPlay COM interface and registering it with the Running Objects Table
I'm having difficulties registering an example XPCOM component into firefox from this example here:
Castle Windsor just came out with a Fluent interface for registering components as an
I was registering to an event in my class, and as per usual I
I am registering my Class in the following method: BOOL CNDSClientDlg::InitInstance() { //Register Window
I'm programmatically registering a group of services that all implement the same interface, IRule.
I have a IUserService (and other services) that I am registering in bulk in
When registering an event via addEventListener on an element, then delete that element without
Currently I'm registering every user control separately in Web.config <pages validateRequest=false> <controls> <add tagPrefix=cc1

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.