I saw Chris Bowen speak at Microsoft in Waltham, MA last week and he tipped me off to a (new?) feature in Visual Studio 2005. In Visual Studio 2005, you can make the IDE detect custom XML schemas and then let you do intellisense. That got me thinking about how to set that up for NHibernate. A quick search on Google got me to a post on Aaron Stebner’s blog with instructions on how to set it up.
It’s amazing simple.
- Download the NHibernate source and go to the “srcNHibernate“ directory
- Copy nhibernate-configuration-2.0.xsd, nhibernate-mapping-2.0.xsd, and nhibernate-generic.xsd to the Visual Studio “schemas“ directory. By default, the schemas directory is “C:Program FilesMicrosoft Visual Studio 8XmlSchemas“.
- Restart Visual Studio
That’s it. No more hunting around and guessing what is valid NHibernate mapping or configuration xml syntax.