How well NHibernate integrates with ASP.NET 3.5?

People have suggested to use NHibernate (NH) for anything below .NET Framework 4.0. I am using Visual Studio 2008 [.NET 3.5 SP1] for building a web application. I want to use NH as opposed to the EF. How easy it is to use NH and which files of NH to bundle while publishing my ASP.NET website on a remote server?

NHibnernate is a powerful and effective tool but there is a learning curve. I recommend you check out the “Getting Started Guide”.

It’s important, though, to evaluate your project and be certain you need NHibernate. NH is an ORM which is specifically designed for projects using a Domain Model or Domain Driven Design. Domain Models are ignorant of databases and as such need a tool to convert them to and from a data store. People these days seem to launch towards Domain Driven Design for anything when it’s strength lies with complex applications or applications that will inevitably become complex. For other projects something simpler may suffice.

If you are not using a Domain Model then you may not need to use NHibernate. You could settle for an Active Record framework using Subsonic or even Linq2Sql. There is even an [URL=“http://www.castleproject.org/activerecord/”]Active Record framework from Castle using NHibernate behind the scenes which simplifies things considerably.

In any case if you follow the getting started guide you will see that certain dlls (nhibernate, log3net, proxy dlls and so on) will end up referenced in your web app and will need to then be deployed with it.