在3个电脑上出现这个问题,全新安装VS 2015 RTM。在VS 2013中打开文件没有问题。
Fix: The Global element ‘configuration’ has already been declared中描述的步骤和其他相关问题没有帮助,因为VS忽略对XML模式对话框的任何更改。想法?
不幸的是,有许多情况可能导致这个问题。
最可能的问题是,文档的模式设置不正确。这可能发生在您在计算机上安装较新版本的.NET和/或Visual Studio时。修复是简单的。
- Open a file in the XML editor.
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.
- 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.
- Click OK.
具体来说,您要将“DotNetConfig.xsd”模式的“使用”列设置为“自动”。