gpt4 book ai didi

c# - nhibernate nuget - 找不到架构

转载 作者:太空宇宙 更新时间:2023-11-03 21:38:09 24 4
gpt4 key购买 nike

我启动了一个 asp.net mvc 项目,我正在尝试使用 nibernate 进行数据库访问。

我在 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。

有什么想法吗?提前致谢。

最佳答案

通常你可以忽略它。

但如果需要,您可以将架构添加到 Visual Studio 中的 XML 验证中。XML 菜单 > 架构 > 添加

从您的包文件夹中选择 nhibernate-configuration.xsd

packages\NHibernate\lib\<.NetVersion>

现在 VS 应该能够正确验证您的 xml (web.config)。

关于c# - nhibernate nuget - 找不到架构,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20705756/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com