Tuesday, January 11, 2011

Tip of the day on NHibernate: IntelliSense for the hbm files

If you're using NHibernate and writing your NHibernate mapping files (*.hbm.xml) by hand, (as opposed to using Fluent NHibernate for example), then you'll probably be interested in the following tip (unless you already done that :-) )

You can have IntelliSense validation and auto-completion in the XML editor for NHibernate xml files (both the *.hbm.xml and hibernate.cfg.xml) by following the following steps:

1. Inside VS, select XML->Schemas.
2. Click "Add..."
3. Browse to the "Required_bins" folder inside of your NHibernate folder (e.g. "C:\Nhibernate3.0\Required_bins")
4. Select both "nhibernate-configuration.xsd" and "nhibernate-mapping.xsd" file and click "Open".
The 2 schemas will be added to the list:

Read more: ArnonA