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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T17:20:47+00:00 2026-05-17T17:20:47+00:00

I just started digging into StructureMap and am running into some problems getting my

  • 0

I just started digging into StructureMap and am running into some problems getting my config up-and-running. It seems that when I try to register Plugins in their respective
PluginFamily they aren’t being found by StructureMap. I’ve gone over many examples on the web but can’t seem to see where I am going wrong.

Can another set of eyes see what my problem is?

Thank you so much for your time.

–Charly

<configuration>

 <configSections>
   <section name="StructureMap"
            type="StructureMap.Configuration.StructureMapConfigurationSection, StructureMap"/>
 </configSections >

 <StructureMap>

   <Assembly Name="Domain.Model" />

   <!-- ICustomField -->
   <PluginFamily Type="Domain.Model.CustomFields.ICustomField"
                 Assembly="Domain.Model"
                 DefaultKey="String">

     <Plugin Type="Domain.Model.CustomFields.StringCustomField"
             Assembly="Domain.Model"
             ConcreteKey="String" />

     <Plugin Type="Domain.Model.CustomFields.DateTimeCustomField"
             Assembly="Domain.Model"
             ConcreteKey="DateTime" />

     <Plugin Type="Domain.Model.CustomFields.BooleanCustomField"
             Assembly="Domain.Model"
             ConcreteKey="Boolean" />

     <Plugin Type="Domain.Model.CustomFields.IntegerCustomField"
             Assembly="Domain.Model"
             ConcreteKey="Integer" />

     <Plugin Type="Domain.Model.CustomFields.DecimalCustomField"
             Assembly="Domain.Model"
             ConcreteKey="Decimal" />

   </PluginFamily>

 </StructureMap>

</configuration>


[TestFixture]
public class BooleanCustomFieldTest
{
       [SetUp]
       public void SetUp()
       {
               log4net.Config.XmlConfigurator.Configure();

               ObjectFactory.Initialize(x =>
                               {
                                   x.PullConfigurationFromAppConfig = true;
                               });
       }

       [Test]
       public void StructureMapCanCreateAnInstanceOfBooleanCustomField()
       {
               ICustomField field =
ObjectFactory.GetNamedInstance<ICustomField>("Boolean");

               Assert.IsNotNull(field);
               Assert.IsInstanceOf<BooleanCustomField>(field);
       }
}
  • 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-17T17:20:47+00:00Added an answer on May 17, 2026 at 5:20 pm

    Charly, I took the code/config you supplied (I had to manually create the instances of ICustomField and the subsequent concrete types as you didn’t supply them in the example code)

    Maybe you could supply the code for your model/interface declarations?

    The test supplied passes for all custom field types in the example I constructed.

    One thing you might want to try is ObjectFactory.WhatDoIHave() which will show you all of the registered types within the container.

    If you want me to send you the working example of your code to see if there are any other differences, give me a shout.

    btw – I used 2.6.2.160 direct from the team city build server.

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

Sidebar

Related Questions

I have just started digging into JavaFX and have a requirement that I am
So I just started digging into web tech, and I'm stuck on the concept
I'm just digging a bit into Haskell and I started by trying to compute
Just started getting a bunch of errors on our C# .Net app that seemed
So I've just started digging into Objective-C, Cocoa, and iPhone development. I've ran into
Just started learning NHiberate. It seems rather tedious to write proper hbm.xml config files
Please bear with me, I've just started digging into this whole CPU thing. The
I've just started digging into XProc (using Calabash ). I have a series of
Just started my first MVC 2.0 .net application. And I set up some default
Just started my first WCF rest project and would like some help on what

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.