xml - VS 2015 RTM web.config 全局元素 'configuration' 已经声明

标签 xml web-config visual-studio-2015

在 3 台全新安装 VS 2015 RTM 的 PC 上遇到此问题。在 VS 2013 中打开文件时没有问题。Fix: The Global element 'configuration' has already been declared 中描述的步骤和其他相关问题无济于事,因为 VS 会忽略 XML 模式对话框中的任何更改。想法?

最佳答案

不幸的是,有许多情况会导致此问题。

最有可能的问题是文档的架构设置不正确。当您在计算机上安装较新版本的 .NET 和/或 Visual Studio 时,可能会发生这种情况。不过修复很简单。

来自Visual Studio documentation :

  1. Open a file in the XML editor.
  2. In the document properties window, click the button on the Schemas field.

    The XML Schemas dialog box is displayed. The dialog box lists all schemas with an .xsd extension in the schema cache (including schemas referenced in the catalog.xml file), and also any schema that is in the current solution, open in Visual Studio, referenced in an xsd:schemaLocation attribute, or referenced in the Schemas property.

  3. Select the schemas to use for validation by doing one of the following:
    • Select a schema listed in the XML Schemas dialog, click the Use column, and then select Use this schema. -OR-
    • Select multiple schemas listed in the XML Schemas dialog, right-click and select Use this schema.
  4. Click OK.

具体来说,您希望将“DotNetConfig.xsd”架构的“使用”列设置为“自动”。

关于xml - VS 2015 RTM web.config 全局元素 'configuration' 已经声明,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31540122/

相关文章:

azure - Visual Studio 2015 - Azure 通知中心 - 缺乏信息

npm - 如何在 VS2015 中禁用 "npm install"

java - 无法将 Spring 应用程序解析为类型

c# - 在 C# 中以编程方式检查 XML 文件格式是否正确的最快方法是什么?

c# - 有没有一种方法可以在不破坏注释和格式的情况下以编程方式将值保存到 web.config appSettings?

c# - Telerik_Web_UI_WebResource_axd 问题

c++ - Visual Studio Profiler 不显示源代码位置

xml - 检查/解决单独 xml 文件中的交叉引用

java - 使布局适应所有屏幕分辨率 - Android

c# - 如何通过 Web.Config 即时更改 Asp.net 主题