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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T04:52:02+00:00 2026-05-20T04:52:02+00:00

I have a Visual Studio 2010 MVC 3 web solution containing a number of

  • 0

I have a Visual Studio 2010 MVC 3 web solution containing a number of projects. One of these projects is my site, another handles data access.

I am using NHibernate to access my database and I have put all my mapping files, nhibernate.config and NH DLLs inside the data access project.

I have enough of an idea how to use NHibernate but I’ve only ever used it in small, single test projects – never a solution with multiple projects

I want to reference the nhibernate.config in my site’s web.config – can I do that?
If not what should I do? Put all the the NH DLLs in my site’s bin folder and stick the NH config straight into my DLL?

Totally lost – all help appreciated!

  • 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-20T04:52:03+00:00Added an answer on May 20, 2026 at 4:52 am

    I would put nhibernate.config in your web project and your data access layer would create a session factory like this:

    private ISessionFactory CreateSessionFactory()
    {
        Configuration cfg;
        cfg = new Configuration().Configure(Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "nhibernate.config"));
        return (cfg.BuildSessionFactory());
    }
    

    Always searching nhibernate.config in a base directory, so you can reference your DAL in other projects.

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

Sidebar

Related Questions

We have a Visual Studio 2010 solution that contains several C# projects in accordance
I have a Visual Studio (2008) solution consisting of several projects, not all in
I have a Visual Studio Solution. Currently, it is an empty solution (=no projects)
When I create a ASP.NET MVC web application in Visual Studio 2010 it offers
I have Visual Studio web test attached nicely to a data source, but I
I just upgraded to Visual Studio 2010 and MVC 2.0 and I noticed the
I am using Visual Studio 2010 and using web deployment to promote the .Net
I'm going to be building some ASP.Net MVC 2 software using Visual Studio 2010
I have Visual Studio 2005 Professional ENU installed and want to create GUIDs using
I have visual studio 2008 installed on my PC. Can anyone tell me what

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.