Open-source project
nhibernate/nhibernate-core avatar
nhibernate/nhibernate-core

NHibernate Core: a C# object-relational mapper distributed through NuGet, SourceForge and a Cloudsmith nightly feed

NHibernate Object Relational Mapper

2,174 stars929 forksC#LGPL-2.1

At a glance

What is it?
NHibernate is an LGPL-2.1 object-relational mapper for .NET, written in C#. This page covers how you obtain it, where its documentation lives, how bugs get reported and what the repository itself leaves unsaid.
Who is it for?
Adopt NHibernate if your team already writes .NET data access and wants an LGPL-2.1 mapper with a long release history and a NuGet package. Skip it if you expect a quickstart inside the repository, because mapping and session usage live on nhibernate.info.
Can I use it commercially?
Yes, with conditions. LGPL-2.1 is a weak copyleft licence: you can use it inside commercial and closed-source software, but if you distribute changes to its own files, you must publish those changes under the same licence.
Is it still maintained?
Yes. The repository last received commits 9 days ago.
What is it written in?
Mainly C#, according to GitHub's language statistics.

Answers come from the project's GitHub data, last synced on November 26, 2026, and from our analysis. They are not legal advice.

From daily snapshots

Star history

  • nhibernate/nhibernate-core2,174 ★ · +0
Star history
Repository2026-10-082026-11-26
nhibernate/nhibernate-core2.2k2.2k

0 Stars in the last 49 days, measured from the daily GitHub snapshot. Compare with other projects

Editorial analysis

NuGet is the quick route, SourceForge is the other one

Adding NHibernate to a project through NuGet, at https://nuget.org/List/Packages/NHibernate, is the route the project itself calls the quickest way to get the latest release. You reference the package from your own .NET project, then write the mapping and session code yourself. There is no project template and no scaffolding command in the repository.

Binaries are also published at http://sourceforge.net/projects/nhibernate. That is the only other channel named for released builds. The repository front page gives the link and nothing about what the download contains, so check the file listing there before you build a deployment process around it.

The tag list shows three recent releases: 5.6.2 on 2026-09-22, 5.7.0 on 2026-06-30 and 5.6.1 on 2026-05-22. A 5.6.2 tag that lands after 5.7.0 means the 5.6 line still received a fix after the next minor version shipped. Pin an exact version in your project file and move it deliberately.

Nightly builds come from a Cloudsmith feed you register in NuGet.Config

Development builds are not on nuget.org. They sit on a Cloudsmith repository at https://cloudsmith.io/~nhibernate/repos/nhibernate-core/packages/, and the project suggests registering the package source in a NuGet.Config file in the top folder of your project. The entry to add looks like this:

xml
<?xml version="1.0" encoding="utf-8"?>
<configuration>
  <packageSources>
    <add key="NHibernateDevBuilds" value="https://nuget.cloudsmith.io/nhibernate/nhibernate-core/v3/index.json" />
  </packageSources>
</configuration>

The key name NHibernateDevBuilds is just a label, and the value is the v3 index URL of the feed. Once registered, a NuGet restore can resolve development packages alongside the normal ones. Package hosting is donated by Cloudsmith, which the project credits on its front page.

A nightly feed is a convenient way to test a fix before it ships, but it gives you no stability promise. Keep it out of the NuGet.Config of any project that builds production artifacts, and use it on a branch or a scratch solution instead.

Breaking changes are documented in releasenotes.txt, not in a changelog on the front page

Upgrades are where an ORM costs you time, and the project says so directly. Maintainers encourage reviewing releasenotes.txt, which sits at the top of the repository, particularly when moving to a later version, and note that these notes generally document any breaking changes.

The word generally matters. It means a missing entry cannot be taken as proof that nothing changed. When you jump from 5.6.1 to 5.7.0, read every entry in between and run your own test suite against a copy of your database, since mapping behaviour and query translation are the areas an ORM upgrade tends to disturb.

The file is plain text, so you can diff it between tags and search it for the names of the mapping or query features you use. The repository also holds ReleaseProcedure.txt and GitReleaseManager.yaml, which describe how maintainers cut releases, not what changed in them.

A bug report without a failing test case is likely to be sent back

Bugs go to the GitHub issue tracker at https://github.com/nhibernate/nhibernate-core/issues. The project states that a test case demonstrating the issue is usually required, and it points to CONTRIBUTING.md and to an old blog post titled "the best way to solve NHibernate bugs: submit a good unit test" for instructions on writing one.

That expectation shapes how you should use the tracker. Writing "my query returns the wrong rows" will not get far. A self-contained test that fails on the current code, with the mapping and the data it needs, is what the maintainers ask for. The repository ships NHibernate.nunit and a src directory with the test projects, and NUnit is credited as the unit-testing framework.

If you cannot reduce the problem to a test, the Users forum is the better first stop, since it exists for help with using NHibernate and does not carry the same expectation.

Support is split between two Google Groups, and neither is the issue tracker

Two official community forums exist, both hosted as Google Groups. NHibernate Users at http://groups.google.com/group/nhusers is for people looking for help using the library. NHibernate Development at http://groups.google.com/group/nhibernate-development is for the developers of NHibernate itself.

If you ask a usage question in the development group, or file a usage question as a GitHub issue, you are in the wrong place by the project's own division. The tracker is for bugs with a reproducing test, the Users group is for questions, and the Development group is for discussion about the code.

The front page also points to the community website at https://nhibernate.info, which holds howtos, blogs and reference documentation under /doc/, /blog/ and /doc/nh/en/index.html. Those pages, not this repository, are where mapping syntax and session handling are explained, so budget reading time there before you evaluate the library.

The credits list shows what sits underneath: Relinq, LinFu, Iesi.Collections and log4net

The credits section names the projects NHibernate relies on, and a few of them tell you something about the internals. Relinq is credited as the Linq provider for NHibernate. LinFu is credited for the proxy implementation, work by Philip Laureano. Log4net, from the Apache Software Foundation, is credited for logging. Iesi.Collections is described as source code taken from an article by Jason Smith.

Build and test tooling is credited too: NUnit for unit testing, Nant for build automation, TeamCity for continuous integration, and AsyncGenerator, a Roslyn based async C# code generator by @maca88. The repository carries both a psake.ps1 with build.ps1 and a default.build, so more than one build entry point exists.

Two practical points follow. Logging goes through log4net conventions, so check how it fits an application that already uses a different logging stack. And because an async code generator is credited, async API surfaces are produced by tooling, which matters if you contribute changes and need to regenerate code.

The repository is a build tree with no quickstart, so the licence and docs are separate decisions

Top-level entries include .config/, build-common/, Tools/, lib/, logo/, doc/ and src/, plus HowInstall.txt, ShowBuildMenu.bat, ShowBuildMenu.sh and a file named "sample build commands.txt". That is the layout of a project you build from source if you want to, not a sample application you clone and run.

Two licences apply. The software is under the GNU Lesser General Public License, version 2.1, in LICENSE.txt. The documentation is separately under the GNU Free Documentation License, version 1.1, in doc/LICENSE.txt. LGPL-2.1 has conditions on distribution of the library itself, so if you ship NHibernate inside a product, read the licence text, not just the badge.

On comparisons, NHibernate is a .NET ORM, while Hibernate is a separate Java project. Entity Framework is Microsoft's own ORM for .NET. The repository front page makes no comparison with either, and carries no benchmark or feature matrix, so any decision against Entity Framework has to come from reading nhibernate.info and trying a prototype.

Editorial conclusion

Adopt NHibernate if your team already writes .NET data access and wants an LGPL-2.1 mapper with a long release history and a NuGet package. Skip it if you expect a quickstart inside the repository, because mapping and session usage live on nhibernate.info. Before committing, open releasenotes.txt for the version you plan to pin and read the breaking-change entries between your current version and that one.

Frequently asked questions

How do I install NHibernate Core?

The quickest route is adding the package to your project through NuGet at https://nuget.org/List/Packages/NHibernate. Binaries are also available from SourceForge at http://sourceforge.net/projects/nhibernate.

Where can I get NHibernate nightly development builds?

Development builds are published on a Cloudsmith feed. Register https://nuget.cloudsmith.io/nhibernate/nhibernate-core/v3/index.json as a package source in a NuGet.Config file in your project's top folder.

Which licence does NHibernate Core use?

The software is distributed under the GNU Lesser General Public License, version 2.1. The documentation is separately under the GNU Free Documentation License, version 1.1.

Where do I report a bug in NHibernate Core?

Use the GitHub issue tracker at https://github.com/nhibernate/nhibernate-core/issues. A test case that demonstrates the issue is usually required, with instructions in CONTRIBUTING.md.

Official sources

  1. License: LGPL-2.1
  2. nhibernate/nhibernate-core on GitHub
  3. Project website
  4. README
  5. Releases
Add this badge to your README

If you maintain this project, the badge below links readers to this analysis and shows its maintenance status from the daily GitHub snapshot. Paste the markdown into your README; add ?metric=license or ?metric=stars to the image URL for a different field.

Add this badge to your README

markdown
[![Hysen Labs](https://hysenlabs.com/badge/nhibernate-nhibernate-core.svg)](https://hysenlabs.com/projects/nhibernate-nhibernate-core)

Star history chart for your README

markdown
[![Star history](https://hysenlabs.com/chart/nhibernate-nhibernate-core.svg)](https://hysenlabs.com/projects/nhibernate-nhibernate-core)

Was this useful?