在 visual studio 中,我有一个使用 MS Enterprise Library 4.0 应用程序 block 的 asp.net 3.5 项目。
当我打开我的网络配置文件时,我的错误列表充满了 99 条消息,例如
Could not find schema information for the element 'dataConfiguration'.
Could not find schema information for the attribute 'defaultDatabase'.
Could not find schema information for the element 'loggingConfiguration'.
Could not find schema information for the attribute 'tracingEnabled'.
Could not find schema information for the attribute 'defaultCategory'.
如果我关闭 Web.config 文件,它们就会消失(但只要我需要再次打开文件,它们就会回来)。
查看之后,我发现这是因为缺少 Visual Studio 需要的 XSD 或架构文件,以便正确“理解”web.config 文件中的架构并为其提供智能感知。
有谁知道如何为 VS 提供适当的架构信息,或者如何关闭这些消息?
@Franci - 感谢您提供信息,我已经尝试过该工具以及 MMC 管理单元(它们往往会破坏 Web.config 中的格式),但它们仍然无法解决我收到的恼人警告。感谢您的尝试。
最佳答案
我已经根据我当前的 app.config 创建了一个新方案来使消息消失。 我刚刚使用了 Visual Studio 中的“创建架构”按钮,并为我创建了一个 xsd 架构。
将模式保存在适当的位置,然后查看 app.config 文件的“属性”选项卡,其中有一个名为 Schemas 的属性。如果您单击那里的更改按钮,您可以选择同时使用原始的 dotnetconfig 架构和您自己新创建的架构。
关于.net - 如何解决 "Could not find schema information for the element/attribute <xxx>"?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/179927/