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

  • Home
  • SEARCH
  • 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 8729523
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T08:50:58+00:00 2026-06-13T08:50:58+00:00

I’m configuring NHibernate on SharePoint 2010 web application. Previously it works fine when mappings

  • 0

I’m configuring NHibernate on SharePoint 2010 web application.
Previously it works fine when mappings and domain were in one project. But during refactoring process I splitted solution on several projects. I’ve also implemented my custom IHttpModule where I want to initialize nhibernate configuration

    protected void context_BeginRequest(object sender, EventArgs e)
    {
        var httpApplication = sender as HttpApplication;

        lock (httpApplication )
        {
            if (!httpApplication.Context.Items.Contains(ApplicationConstants.IsApplicationInitialized))
            {
                httpApplication.Context.Items.Add(ApplicationConstants.IsApplicationInitialized, true);
                InitInRequest(httpApplication);
            }
        }

        httpApplication.Context.Items.Add(ApplicationConstants.SESSION, NhibernateManager.GetSession());
    }

    private void InitInRequest(HttpApplication httpApplication)
    {
        NhibernateManager.Init(ApplicationVariables.ApplicationSettingsPath);
    }

And NHibernateManager.Init():

    public static void Init(string configurationFilePath)
    {
        specifiedConfigurationFilePath = configurationFilePath;
        Configure();
        InitSessionFactory();
    }

    private static void Configure()
    {
        if (config == null)
        {
            if (string.IsNullOrEmpty(specifiedConfigurationFilePath) == false)
            {
                config = new Configuration();
                config = config.Configure(specifiedConfigurationFilePath);
                config = Fluently.Configure(config)
                                    .Mappings(m => m.FluentMappings.AddFromAssemblyOf<ItemMap>())
                                    .BuildConfiguration();
            }
            else
            {
                config = Fluently.Configure()
                                    .Mappings(m => m.FluentMappings.AddFromAssemblyOf<ItemMap>())
                                    .BuildConfiguration();
            }
        }
    }

And in BuildConfiguration() I have very strange error (InnerException): “Entry point was not found.” Stack trace shows that getting mapping information is cause of error:

at System.Collections.Generic.IDictionary`2.TryGetValue(TKey key, TValue& value)
at NHibernate.Cfg.Configuration.GetClassMapping(String entityName)
at NHibernate.Cfg.Configuration.GetClassMapping(Type persistentClass)
at FluentNHibernate.PersistenceModel.Configure(Configuration cfg)
at FluentNHibernate.Cfg.MappingConfiguration.Apply(Configuration cfg)
at FluentNHibernate.Cfg.FluentConfiguration.BuildConfiguration()

All assemblies are in the GAC. I tried to copy them in _app_bin or bin but without success.

UPDATE

Please, help me! I’m stuck with this weird problem 🙁

  • 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-13T08:50:59+00:00Added an answer on June 13, 2026 at 8:50 am

    I found solution.

    Take a look at my configuration lines:

    config = new Configuration();
    config = config.Configure(specifiedConfigurationFilePath);
    config = Fluently.Configure(config)
                     .Mappings(m => m.FluentMappings.AddFromAssemblyOf<ItemMap>())
                     .BuildConfiguration();
    

    I’m creating new nhibernate configuration object passing it to fluent-nhibernate static initializer method. This is a point where things happen. Fluent-nhibernate can’t take configuration from specified file. Instead it can take nhibernate configuration object with file path specified which it then uses to build configuration.
    Previous version of my application was in one assembly and this way of configuration seems to work fine. But when I split up application the issue appeared.
    So to solve the problem I should to take nhibernate configuration info from web.config file. I can’t merge settings of timer job and web-application in one file as I could in single-assembly project. So I had to have several configuration files and always use classic lines like that:

    Fluently
     .Configure()
      .Mappings(p => p.FluentMappings
                       .AddFromAssemblyOf<ItemMap>())
                        .BuildConfiguration()
    

    It’s appear to be some sort of fluent-nhibernate bug or something…

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

Sidebar

Related Questions

Seemingly simple, but I cannot find anything relevant on the web. What is the
Configuring TinyMCE to allow for tags, based on a customer requirement. My config is
link Im having trouble converting the html entites into html characters, (&# 8217;) i
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I want to count how many characters a certain string has in PHP, but
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I am reading a book about Javascript and jQuery and using one of the
I have a French site that I want to parse, but am running into
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
This could be a duplicate question, but I have no idea what search terms

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.