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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T07:55:12+00:00 2026-05-13T07:55:12+00:00

I want a simple unit test configuration. My understanding is that the sqlite fluent

  • 0

I want a simple unit test configuration. My understanding is that the sqlite fluent config defaults to Castle, and I have a reference set to NHibernate.ByteCode.Castle.dll, yet I am getting an error saying there is no ProxyFactory setting set.

What am I missing?

Cheers,
Berryl

=== the CODE ===

public abstract class InMemoryDatabase : IDisposable
{
    private static Configuration _cfg;
    private static ISessionFactory _sessionFactory;

    protected InMemoryDatabase()
    {
        _sessionFactory = _createSessionFactory();
        Session = _sessionFactory.OpenSession();
        _buildSchema(Session);
    }

    protected ISession Session { get; set; }

    #region IDisposable Members

    public void Dispose() { Session.Dispose(); }

    #endregion

    private static ISessionFactory _createSessionFactory()
    {
        return Fluently.Configure()
            .Database(SQLiteConfiguration.Standard.InMemory().ShowSql())
            .Mappings(M =>
                M.FluentMappings.AddFromAssemblyOf<User>())
            .ExposeConfiguration(Cfg => _cfg = Cfg)
            .BuildSessionFactory();
    }

    private static void _buildSchema(ISession Session)
    {
        var export = new SchemaExport(_cfg);
        export.Execute(true, true, false, Session.Connection, null);
    }
}

==== the exception ====

TestCase 'SmackNhibTestLab.FluentMapping.Tests.UserClassMapTests.PersistenceSpec_ok'
failed: TestFixtureSetUp failed in UserClassMapTests
TestFixture failed: FluentNHibernate.Cfg.FluentConfigurationException : 
An invalid or  incomplete configuration was used while creating a SessionFactory. Check PotentialReasons collection, and InnerException for more detail.


----> NHibernate.Bytecode.ProxyFactoryFactoryNotConfiguredException : The ProxyFactoryFactory was not configured. 
Initialize 'proxyfactory.factory_class' property of the session-factory configuration section with one of the available NHibernate.ByteCode providers.
Example:
<property name='proxyfactory.factory_class'>NHibernate.ByteCode.LinFu.ProxyFactoryFactory, NHibernate.ByteCode.LinFu</property>
Example:
<property name='proxyfactory.factory_class'>NHibernate.ByteCode.Castle.ProxyFactoryFactory, NHibernate.ByteCode.Castle</property>
at FluentNHibernate.Cfg.FluentConfiguration.BuildSessionFactory()

0 passed, 1 failed, 0 skipped, took 2.55 seconds (NUnit 2.5.2).
  • 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-13T07:55:13+00:00Added an answer on May 13, 2026 at 7:55 am

    You can set the property yourself easily enough – see below code to see a good way to see a good way do it. I still would have expected this line of code to have been baked into the SQLite default config?

    private static ISessionFactory _createSessionFactory() {
        var sqLiteConfiguration = Standard.InMemory().ShowSql();
        sqLiteConfiguration.ProxyFactoryFactory(typeof(ProxyFactoryFactory).AssemblyQualifiedName); <== ** OK now
    
        return Fluently.Configure()
                .Database(sqLiteConfiguration)
                .Mappings(M =>
                    M.FluentMappings.AddFromAssemblyOf<User>())
                .ExposeConfiguration(Cfg => _cfg = Cfg)
                .BuildSessionFactory();
        }
    

    Cheers,
    Berryl

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

Sidebar

Related Questions

I have a simple unit test case (extensive question here ) on a configuration
I want a simple function that receives a string and returns an array of
I just want a simple tool that will help me quickly write scripts/packages that
I just want a simple SVG image that has some arbitrary text on an
I have a deceptively simple scenario, and I want a simple solution, but it's
I want to create a simple http proxy server that does some very basic
I'm new to C# and trying to write a simple GUI Unit Test with
I want to Unit-test a method like the following: public ActionResult StoreFile(FormCollection form, string
I want to test a piece of code that uses network (the NSURLConnection class,
I want something simple in order to experiment/hack. I've created a lot interpreters/compilers for

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.