Reputation: 135
Im add to project Fluent and Fluent NHibernate and I have on Fluently: Project.DNX Core 5.0 - Not available.
ISessionFactory sessionFactory = Fluently.Configure()
.Database(MsSqlConfiguration.MsSql2012
I dont know what to do.
Upvotes: 1
Views: 1939
Reputation: 9279
I searched for a while to see if there are plans to bring NHibernate to the new, cross-platform .NET Core and here is what it looks like:
If I understand it correctly, it means that if you want to target Linux/Mac platforms with your MVC6 application, and you wanted to use NHibernate with it, hold no breath as it won't happen.
In this situation, Entity Framework Core seems to me like the natural alternative to use and learn. It's open source, actively developed, with good opinions among developers, and designed with MVC 6+ in mind.
Upvotes: 0
Reputation: 409
If you don't want to edit project.json you can put,
#if DNX451
//whatever code is giving issue with DNX Core 5.0
#endif
You can use this anywhere even when defining namespaces, e.g. what I recently used in my asp.net project for using Xml was;
#if DNX451
using System.Xml;
#endif
Upvotes: 0
Reputation: 333
As far as I remember NHibernate works only now only on dnx451
framework. If you are compiling it for Windows you can remove dnxcore50
from frameworks in project.json
Upvotes: 3