views:

34

answers:

3

I'm learning NHibernate and I added <hibernate-configuration xmlns="urn:nhibernate-configuration-2.2"> to App.config. Visual Studio reported a message:

Could not find schema information for the element 'urn:nhibernate-configuration-2.2:hibernate-configuration'.

I know this is not a problem, but if VS knew the schema, IntelliSense would work. How can I add the schema?

A: 

Copy the two .xsd from the folder Required_Bins from the NHibernate download to C:\Program Files\Microsoft Visual Studio 10.0\Xml\Schemas. If you use other version of VS than 2008 (or if you have VS installed elsewhere), change the path accordingly.

svick
This is NOT the recommended way.
Diego Mijelshon
+1  A: 

Just copy the nhibernate.xxx.xsd files into your

%Program Files%\Microsoft Visual Studio %version%\xml\Schemas 

folder.

Goblin
This is NOT the recommended way.
Diego Mijelshon
+2  A: 

Just include the XSD files in any of your projects or as Solution Items.

Diego Mijelshon
So I have to do this for every solution that uses NHibernate? That seems like a useless work, when I can do it once and forget about it.
svick
You have to add a reference to NHibernate to every solution that uses it. How is this step any different?
Diego Mijelshon
It's different, because it can be easily avoided.
svick
OK, if saving two mouseclicks is more important to you than, for example, having the solution work for all your team (not just you) WITHOUT having to add something to Visual Studio, go ahead.
Diego Mijelshon
Also, NHibernate documentation recommends copying the to the Visual Studio directory.
svick
And it's wrong (I'll upload a patch for that). It might have been correct for VS2003, but it's not the recommended method anymore.
Diego Mijelshon
http://216.121.112.228/browse/NH-2321
Diego Mijelshon