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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T05:41:02+00:00 2026-06-17T05:41:02+00:00

I am trying to run some integration test and use this: public class ServiceLocatorInitializer

  • 0

I am trying to run some integration test and use this:

public class ServiceLocatorInitializer
{
public static void Init()
{
    IWindsorContainer container = new WindsorContainer();

    container.Register(
        Component
        .For(typeof(IEntityDuplicateChecker))
        .ImplementedBy(typeof(EntityDuplicateChecker))
        .Named("entityDuplicateChecker"));

    container.Register(
        Component.For(typeof(ISessionFactoryKeyProvider))
        .ImplementedBy(typeof(DefaultSessionFactoryKeyProvider))
        .Named("sessionFactoryKeyProvider"));

    ServiceLocator.SetLocatorProvider(() => new WindsorServiceLocator(container));
}
}

plus this:

<?xml version="1.0" encoding="utf-8" ?>
    <hibernate-configuration xmlns="urn:nhibernate-configuration-2.2">
      <session-factory>
        <property name="connection.provider">NHibernate.Connection.DriverConnectionProvider</property>
        <property name="dialect">NHibernate.Dialect.SQLiteDialect</property>
        <property name="connection.driver_class">NHibernate.Driver.SQLite20Driver</property>
        <property name="connection.connection_string">Data Source=:memory:;Version=3;New=True;</property>
        <property name="connection.release_mode">on_close</property>
        <property name="show_sql">true</property>
        <property name="proxyfactory.factory_class">NHibernate.ByteCode.Castle.ProxyFactoryFactory, NHibernate.ByteCode.Castle</property>
      </session-factory>
    </hibernate-configuration>

I have a reference to Castle.Windsor version 3.1.0.0 but get this error:

Could not load file or assembly ‘Castle.Windsor, Version=2.5.1.0,
Culture=neutral, PublicKeyToken=407dd0808d44fbdc’ or one of its
dependencies. The located assembly’s manifest definition does not
match the assembly reference. (Exception from HRESULT: 0x80131040)

Not sure what the reason is and how to overcome this? Thanks.

  • 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-06-17T05:41:03+00:00Added an answer on June 17, 2026 at 5:41 am

    WindsorServiceLocator is build against an older version of Castle and has not been updated.

    You need to add a BindingRedirect in the App.Config of your test project, you should be able to add them by opening the Nuget Package Manager Console in visual studio, select the test project and run

    Add-BindingRedirect
    

    Check the App.Config and you should now have binding redirects for the assemblies.

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

Sidebar

Related Questions

This is some sample test app i trying to learn Parallel.Foreach Loop functionality static
So, I'm confused by this failure. I'm using MSTest to run some integration tests
I'm trying to use Maven to start an application prior to running some integration
I'm trying to integration test a class that uses the Mail Plugin. When I
I'm trying to get some database related integration tests running on a MSTest test
I am trying to implement some integration tests for my application to test a
I'm using Maven 2.2 with Grails 1.2.1. When trying to run the integration-test target,
I am trying to run some integration tests in continous integration with TeamCity and
I am trying to run some javascript code that is created by my codebehind
I'm trying to run some unit-tests for NxBRE before I start referencing it's implementation

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.