2013-12-20 39 views
1

我開始了一個asp.net mvc項目,我試圖使用nibernate的數據庫訪問。nhibernate nuget - 架構沒有找到

我得到以下warings在Visual Studio:

Could not find schema information for the element 'urn:nhibernate-configuration-2.2:hibernate-configuration'. 
Could not find schema information for the element 'urn:nhibernate-configuration-2.2:session-factory'. 
Could not find schema information for the element 'urn:nhibernate-configuration-2.2:property'. 
Could not find schema information for the attribute 'name'. 
Could not find schema information for the element 'urn:nhibernate-configuration-2.2:property'. 
Could not find schema information for the attribute 'name'. 
Could not find schema information for the element 'urn:nhibernate-configuration-2.2:property'. 
Could not find schema information for the attribute 'name'. 

我Web.conf:

<?xml version="1.0" encoding="utf-8"?> 
<configuration> 
    <configSections> 
    <section name="hibernate-configuration" type="NHibernate.Cfg.ConfigurationSectionHandler, NHibernate" /> 
    </configSections> 
.... 
    <hibernate-configuration xmlns="urn:nhibernate-configuration-2.2"> 
    <session-factory> 
     <property name="dialect">NHibernate.Dialect.MySQLDialect</property> 
     <property name="connection.driver_class">NHibernate.Driver.MySqlDataDriver</property> 
     <property name="connection.connection_string_name">MainDb</property> 
    </session-factory> 
    </hibernate-configuration> 
... 

我安裝通過的NuGet NHibernate的。

任何想法? 在此先感謝。

回答

4

通常你可以簡單地忽略它。

但是,如果你願意,你可以在Visual Studio中將模式添加到你的xml驗證中。 XML菜單>架構>添加

從你的包文件夾選擇的NHibernate-configuration.xsd

包\ NHibernate的\ LIB \ < .NetVersion>

現在VS應該能夠驗證你的xml(web.config)正確。

+1

感謝您的幫助! – user3123036