.net - How to add NHibernate configuration file to use NHibernate.Search? -


I try to use NHibernate. The search that I made from the trunk and used with NHibernate 2.0.1 When I add some NHibernate. Configure search properties in the configuration file:

  & lt; Property name = "hibernate.search.default.directory_provider" & gt; NHibernate.Search.Storage.RAMDirectoryProvider, NHibernate.Search & lt; / Property & gt; & Lt; Property Name = "hibernate.search.default.indexBase" & gt; ~ \ Index \ & lt; / Property & gt;  

I have an invalid system Xml.Schema.XmlSchemaException has been found: Enumeration halts fail when I use:

  var configuration = new configuration (). Configure ();  

So how can I solve this problem?

Ensure that the NHibernate.Search property that you define is included in the NHS-configuration block and Not in the standard NHibernate configuration block. Your Web Config should look like this:

  & lt; Section name = "hibernate-configuration" type = "NHibernate.Cfg.ConfigurationSectionHandler, NHibernate" /> & Lt; Section name = "NHS-configuration" type = "NHibernate.Search.Cfg.ConfigurationSectionHandler, NHibernate.Search" /> & Lt; Hibernate-configuration xmlns = "vase: nibinet-configuration-2.2" & gt; & Lt ;! - nhibernate configuration block - & gt; & Lt; / Hibernate-configuration & gt; & Lt; NHS-configuration xmlns = 'cache: NHS-Configuration-1.0' & gt; & Lt; Search-factory & gt; & Lt; Property Name = 'hibernate.search.default.directory_provider' & gt; NHibernate.Search.Store.FSDirectoryProvider, NHibernate.Search & lt; / Property & gt; & Lt; Property Name = 'hibernate.search.default.indexBase' & gt; ... & lt; / Property & gt; & Lt; / Search-factory & gt; & Lt; / NHS Configuration & gt;  

Comments