How to add NHibernate XML schema to Visual Studio?

我怕爱的太早我们不能终老 提交于 2019-12-03 23:01:14

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

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.

neilhighley

For those using nuget, and multiple versions of nHibernate, Source control, et al...

  1. Open up the hbm XML file in your project.

  2. Select the XML menu item and select Schemas in the drop down (or press ALT, X, S)

  3. Click Add

  4. Browse to your Solution and open the packages folder in the root

  5. Find the nHibernate package folder

  6. Select both the XSD files within the lib folder

Patrick D'Souza

I tried some of the above ideas with VS2012 and NHibernate 3.3.1.4000 and it did not work, but the following tip given by ArnonA worked for me. It should also be SVN safe, if you work on multiple projects with different versions of nHibernate

  1. Inside VS2012, open up the nHibernate xml file you would like to edit.
  2. Once in the xml file editor, the XML menu should be visible in the main VS menu.
  3. Click on XML->Schemas menu, this should open the "XML Schemas" dialog.
  4. Add the "nhibernate-configuration.xsd" and "nhibernate-mapping.xsd" files and click ok.
  5. Done :)
Goblin

Just copy the nhibernate.xxx.xsd files into your

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

folder.

You should add xsd files to the solution. This would prevent issues of missing files if your team needs to download the project from a code repository.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!