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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T03:17:31+00:00 2026-05-27T03:17:31+00:00

I have never used Windsor before but have used other DI frameworks, and I

  • 0

I have never used Windsor before but have used other DI frameworks, and I have got a rather strange issue at the moment.

I have a factory class which takes a string in its constructor, however whenever I try and resolve that object I get an exception saying:

Handler for System.String was not found.

<Message>Handler for System.String was not found.</Message>
<StackTrace>at Castle.MicroKernel.Resolvers.DefaultDependencyResolver
     .TryGetHandlerFromKernel(DependencyModel dependency, CreationContext context) 
     in d:\60b7fa65294e7792\src\Castle.Windsor\MicroKernel\Resolvers\DefaultDependencyResolver.cs:line 403
at Castle.MicroKernel.Resolvers.DefaultDependencyResolver.ResolveCore(CreationContext context, ComponentModel model, DependencyModel dependency) in d:\60b7fa65294e7792\src\Castle.Windsor\MicroKernel\Resolvers\DefaultDependencyResolver.cs:line 270</StackTrace>
<Type>Castle.MicroKernel.Handlers.HandlerException</Type>
</InnerException>
<Message>Missing dependency.
Component SomeExampleFactory has a dependency on System.String, which could not be 
resolved.
Make sure the dependency is correctly registered in the container as a service, or 
provided as inline argument.</Message>

The class looks something like:

public interface IDummyFactory
{
    void DoSomething();
}

public class DummyFactory : IDummyFactory
{
    private string someString;

    public DummyFactory(string someConstructorArg)
    {
        someString = someConstructorArg;
    }
}

With DI setup below:

var someString = "some constructor arg";
_container.Register(Component.For<IDummyFactory>()
                             .ImplementedBy<DummyFactory>()
                             .DependsOn(someString));

I am assuming it is trying to do some sort of casting or formatting that is causing it to bomb out, but as the type itself is a string, and the variable being passed in a string… it may even be a case that it is trying to map the type of that variable rather than the variable content, but I do not know enough about the DI framework and the documentation around this area

  • 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-27T03:17:32+00:00Added an answer on May 27, 2026 at 3:17 am

    Try calling the overload of DependsOn which takes an IDictionary of Key/Value pairs to specify dependencies:

    _container.Register(
        Component.For<IDummyFactory>()
            .ImplementedBy<DummyFactory>()
            .DependsOn(new Hashtable 
            { 
                { "someConstructorArg", "some constructor arg" }
            }));
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have never used Try-catch in my code before, but now I need to
G'day, I have never really used excel formulas before but need to convert a
I have never used CRON before but I want to use CRON in order
I have never used CRON or anything like that, rails etc.. before, but I
I have never used procmail before but I believe (from my R&D) that it
I have never used namespaces for my code before. (Other than for using STL
I have never used Heroku before, but our client wants us to use it.
I have never used a lightbox before, but recently started thinking about using a
I have never used JodaTime before, but answering this question, How to get ordinal
I have never used Prototype before. But now when I'm using Rails, it seems

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.