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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T12:01:48+00:00 2026-06-09T12:01:48+00:00

I have run into a very weird issue. I have several working Fitnesse tests

  • 0

I have run into a very weird issue. I have several working Fitnesse tests which insert data in a database, then test my full MVC application stack.

When I try to add 2 Component property mappings to my entity map, I get an error saying “Unable to find assembly ‘FluentNHibernate …’ which seems somewhat cryptic.

All of this is being run through Fitnesse, so this could be an issue with how Fitnesse loads dependencies… I have no idea of knowing for sure though. The only thing I know is that this code runs fine until I add the 2 “Component” mappings. On top of that, those mappings run fine when this code is run through the normal web application (so I know the “Component” mapping and SessionFactory class works outside of Tests project).

Does anyone have any ideas why I would get the error message I’m getting? Please let me know if there is any other code I need to post. Any help is greatly appreciated!

DLL Versions:

  • NHibernate – 3.3.1.4000
  • FluentNHibernate – 1.3.0.733
  • Fitnesse – v20111026
  • fitSharp – 2.2.4498.25493

Here is my entity:

// namespace Reporting.Domain
public class Holdings
{
    public virtual int HoldingsId { get; set; }
    public virtual DateTime AsOfDate { get; set; }
    public virtual string Portfolio { get; set; }

    // need to add these next 2 properties!
    public virtual Balances PriorPeriod { get; set; }
    public virtual Balances CurrentPeriod { get; set; }
}

my mapping file:

// namespace Reporting.Infrastructure
public sealed class HoldingsMap : ClassMap<Holdings>
{
    public HoldingsMap()
    {
        Id(x => x.HoldingsId).GeneratedBy.Identity();
        Map(x => x.AsOfDate).Not.Nullable();
        Map(x => x.Portfolio).Not.Nullable();

        // adding these lines eventually leads to the error
        Component(x=> x.PriorPeriod).ColumnPrefix("Prior");
        Component(x=> x.CurrentPeriod).ColumnPrefix("Current");
    }
}

my SessionFactory (the error happens when BuildSessionFactory is called):

// namespace Reporting.Infrastructure
public class SessionFactory
{
    public ISessionFactory CreateSession(Action<Configuration> configurationFunction)
    {
        return CreateConfiguration().ExposeConfiguration(c => {}).BuildSessionFactory();
    }

    private FluentConfiguration CreateConfiguration()
    {
        var connectionString = "...";
        var msSqlConfiguration = MsSqlConfiguration.MsSql2008.ConnectionString(connectionString);
        var database = Fluently.Configure().Database(msSqlConfiguration);
        return database.Mappings(m => m.FluentMappings.AddFromAssemblyOf<SessionFactory>().Conventions.Add(ForeignKey.EndsWith("Id")));
    }
}

I get this stack trace:

__EXCEPTION__:System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> FluentNHibernate.Cfg.FluentConfigurationException: An invalid or incomplete configuration was used while creating a SessionFactory. Check PotentialReasons collection, and InnerException for more detail.

 ---> FluentNHibernate.Cfg.FluentConfigurationException: An invalid or incomplete configuration was used while creating a SessionFactory. Check PotentialReasons collection, and InnerException for more detail.

 ---> System.Runtime.Serialization.SerializationException: Unable to find assembly 'FluentNHibernate, Version=1.3.0.733, Culture=neutral, PublicKeyToken=8aa435e3cb308880'.
   at System.Runtime.Serialization.Formatters.Binary.BinaryAssemblyInfo.GetAssembly()
   at System.Runtime.Serialization.Formatters.Binary.ObjectReader.GetType(BinaryAssemblyInfo assemblyInfo, String name)
   at System.Runtime.Serialization.Formatters.Binary.ObjectMap..ctor(String objectName, String[] memberNames, BinaryTypeEnum[] binaryTypeEnumA, Object[] typeInformationA, Int32[] memberAssemIds, ObjectReader objectReader, Int32 objectId, BinaryAssemblyInfo assemblyInfo, SizedArray assemIdToAssemblyTable)
   at System.Runtime.Serialization.Formatters.Binary.__BinaryParser.ReadObjectWithMapTyped(BinaryObjectWithMapTyped record)
   at System.Runtime.Serialization.Formatters.Binary.__BinaryParser.Run()
   at System.Runtime.Serialization.Formatters.Binary.ObjectReader.Deserialize(HeaderHandler handler, __BinaryParser serParser, Boolean fCheck, Boolean isCrossAppDomain, IMethodCallMessage methodCallMessage)
   at System.Runtime.Serialization.Formatters.Binary.BinaryFormatter.Deserialize(Stream serializationStream, HeaderHandler handler, Boolean fCheck, Boolean isCrossAppDomain, IMethodCallMessage methodCallMessage)
   at System.Runtime.Serialization.Formatters.Binary.BinaryFormatter.Deserialize(Stream serializationStream, HeaderHandler handler, Boolean fCheck, IMethodCallMessage methodCallMessage)
   at FluentNHibernate.Utils.Extensions.DeepClone[T](T obj)
   at System.Linq.Enumerable.WhereSelectListIterator`2.MoveNext()
   at System.Linq.Enumerable.FirstOrDefault[TSource](IEnumerable`1 source, Func`2 predicate)
   at FluentNHibernate.Visitors.ComponentReferenceResolutionVisitor.ProcessComponent(ReferenceComponentMapping mapping)
   at FluentNHibernate.MappingModel.ClassBased.ReferenceComponentMapping.AcceptVisitor(IMappingModelVisitor visitor)
   at FluentNHibernate.MappingModel.MappedMembers.AcceptVisitor(IMappingModelVisitor visitor)
   at FluentNHibernate.MappingModel.ClassBased.ClassMappingBase.AcceptVisitor(IMappingModelVisitor visitor)
   at FluentNHibernate.MappingModel.HibernateMapping.AcceptVisitor(IMappingModelVisitor visitor)
   at FluentNHibernate.Utils.CollectionExtensions.Each[T](IEnumerable`1 enumerable, Action`1 each)
   at FluentNHibernate.PersistenceModel.ApplyVisitors(IEnumerable`1 mappings)
   at FluentNHibernate.PersistenceModel.BuildMappings()
   at FluentNHibernate.PersistenceModel.Configure(Configuration cfg)
   at FluentNHibernate.Cfg.MappingConfiguration.Apply(Configuration cfg)
   at FluentNHibernate.Cfg.FluentConfiguration.BuildConfiguration()
   --- End of inner exception stack trace ---
   at FluentNHibernate.Cfg.FluentConfiguration.BuildConfiguration()
   at FluentNHibernate.Cfg.FluentConfiguration.BuildSessionFactory()
   --- End of inner exception stack trace ---
   at FluentNHibernate.Cfg.FluentConfiguration.BuildSessionFactory()
   at Reporting.Infrastructure.SessionFactory.CreateSession() in Reporting.Infrastructure\SessionFactory.cs:line 32
   at Reporting.FitnesseTests.Database.Setup() in Reporting.FitnesseTests\Database.cs:line 23
   --- End of inner exception stack trace ---
   at fitSharp.Machine.Model.TypedValue.ThrowExceptionIfNotValid()
   at fitSharp.Slim.Operators.ExecuteCall.ExecuteOperation(Tree`1 parameters)
   at fitSharp.Slim.Operators.InvokeInstructionBase.Invoke(TypedValue instance, MemberName memberName, Tree`1 parameters)

FWIW, this is how I use the session factory from my Fitnesse Tests project:

// namespace Reporting.FitnesseTests
public class Database
{
    public static ISession Session { get; private set; }

    public static void Setup()
    {
        Session = new SessionFactory().CreateSession().OpenSession();
    }
}

and my Fitnesse Classpath is:

!path ..\Reporting.FitnesseTests\bin\Debug\Reporting.FitnesseTests.dll
  • 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-09T12:01:50+00:00Added an answer on June 9, 2026 at 12:01 pm

    Try putting the DLLs that the test is looking for in the same folder as the fitsharp Runner.exe. One problem that I ran into is that .NET run-time dependencies that are defined in app.config are resolved from the directory in which the process is executed from which in this case is probably the directory where fitsharp resides. There is a apparently a way to use the fitsharp suite configuration file to change this behavior but I haven’t been able to get it working successfully (http://fitsharp.github.com/FitSharp/SuiteConfigurationFile.html).

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

Sidebar

Related Questions

Hi I have run into a very weird problem. I have a basic chrome
I have run into an issue regarding how to identify which user owns particular
I have run into an issue and I think that my solution is very
I have run into a very strange behaviour I can’t make sense of. I
I've recently started using GNU Screen but have run into a very annoying problem.
I am modifying a wordpress theme completely, and have run into one very simple
I've been coding a very sizable project and I have run into trouble with
I have run into a very interesting problem trying to debug my custom PHP
I have run into these problems several times and was never able to find
I have run into a very confusing situation with maps on the iPhone. Everything

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.