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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T01:04:50+00:00 2026-05-16T01:04:50+00:00

I am trying to inject an IList into a constructor and want to know

  • 0

I am trying to inject an IList into a constructor and want to know if this is possible and if so could someone enlightern me? The fact its asking for a type converter makes me think I can’t do it.

I tried….

<object name="DataLayer.DataServices.IGetAccountDatabase" type="DataServices.LinqToEntities.EntityDataModel, DataServices.LinqToEntities" singleton="false"></object>
<object name="DataLayer.DataServices.IGetAccountMessage" type="DataServices.VMX.VmxModel, DataServices.VMX" singleton="false"></object>

<object name="DataLayer.DataServices.IDataService" type="DataServices.NavigationModel, DataServices" singleton="false">
    <constructor-arg>
        <list element-type="DataLayer.DataServices.IGetAccount, DataLayer" >
          <idref object="DataLayer.DataServices.IGetAccountMessage"/>
          <idref object="DataLayer.DataServices.IGetAccountDatabase"/>
        </list>
    </constructor-arg>
</object>

Error creating object with name ‘DataLayer.DataServices.IDataService’ defined in ‘file [D:\Workspace\DataServices\Main\Source\DataServices\TestResults\2010-07-30 11_58_31\Out\Spring.xml]’ : Initialization of object failed : Unable to convert managed list element ‘DataLayer.DataServices.IGetAccountMessage’ from [System.String] into [DataLayer.DataServices.IGetAccount] during initialization of property ‘constructor argument’ for object ‘DataLayer.DataServices.IDataService’. Do you have an appropriate type converter registered?

Any help appreciated. thnx

  • 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-16T01:04:50+00:00Added an answer on May 16, 2026 at 1:04 am

    I think that if you specify the objects with an id instead of a name it should work (it is generally better to use id’s). The idref element can only be used to refer to objects by id.

    If the object DataLayer.DataServices.IDataService and the objects DataLayer.DataServices.IGetAccountMessage and DataLayer.DataServices.IGetAccountDatabase are part of the same xml file, you can also use the local attribute of idref. Then you get an error when the xml file is parsed, even before the dependencies will be resolved.

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

Sidebar

Related Questions

I'm trying to inject a Map into a Grails controller. I want to inject
I am trying to inject a DAO into an CXF Service. For this purpose
I'm trying to inject an IEnumerable into a constructor with Ninject. My constructor looks
I am trying to inject dependency to my session dictionary class into my controller's
I am trying to inject JQuery into a UIWebView of a page that I
Can anyone explain this to me. I'm trying to inject a CSS file onto
I am using FluentValidation and Ninject. I am trying to inject a service into
I am trying to use Spring to inject @PersistenceContext entityManager into my service. The
I am trying to properly use Ninject to inject log4net logging into my MVC3
Hi i am trying to inject custom css into a page my manifest file

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.