修复:全局元素“配置"已经声明 [英] Fix: The Global element 'configuration' has already been declared
问题描述
我使用了第二种解决方案如何解决可以找不到元素/属性的架构信息
即使用创建方案的按钮创建了一个 XSD.我将 app.config 中的样式表更改为 app.xsd,但现在收到警告:
全局元素配置"已经在 app.xsd 中声明
即使更改名称也会显示警告.有人对此有解决方案吗?
我遇到了与您所指问题类似的问题,我按照这些说明操作,一切正常.首先确保 EnterpriseLibrary.Configuration.xsd
在 %ProgramFiles%\Microsoft Visual Studio [version]\Xml\Schemas\
中,然后执行以下操作:
企业库将架构安装到 Visual Studio 中,该架构提供用于在 Visual Studio XML 编辑器中编辑企业库配置文件的 IntelliSense®.您必须先开启架构,然后才能使用它.
<块引用>
启用企业库配置架构
<块引用>
- 在解决方案资源管理器中双击 Visual Studio 中的配置文件.
<块引用>
- 在 XML 菜单上,单击架构...以打开 XML 架构对话框.
<块引用>
- 找到名为 EnterpriseLibrary.Configuration.xsd 的架构.这是自动安装的.但是,如果它未显示在列表中,请单击添加并导航到文件夹 %Program Files%\Microsoft Visual Studio [version] \Xml\Schemas,然后选择 EnterpriseLibrary.Configuration.xsd 并单击打开.
<块引用>
- 将 Use 列中的值更改为 Use this schema.然后点击确定.
文章链接在这里 ,希望这有帮助
I used the second solution of How to resolve "Could not find schema information for the element/attribute <xxx>"?
I.e. created a XSD with the button to create a scheme. I changed the stylesheet in app.config to app.xsd but now I get the warning:
The Global element 'configuration' has already been declared in app.xsd
Even when changing the name the warning is shown. Does anybody have a solution for this?
I had a similar problem to the question you are referring to, I followed these instructions and everything was fine. Make sure the EnterpriseLibrary.Configuration.xsd
is in %ProgramFiles%\Microsoft Visual Studio [version]\Xml\Schemas\
first of all, then do this:
Enterprise Library installs a schema into Visual Studio that provides IntelliSense® for editing Enterprise Library configuration files in the Visual Studio XML editor. You must turn on the schema before you can use it.
To enable the Enterprise Library configuration schema
- Open the configuration file in Visual Studio by double-clicking it in Solution Explorer.
- On the XML menu, click Schemas... to open the XML Schemas dialog.
- Locate the schema named EnterpriseLibrary.Configuration.xsd. This is installed automatically. However, if it is not shown in the list, click Add and navigate to the folder %Program Files%\Microsoft Visual Studio [version] \Xml\Schemas, then select EnterpriseLibrary.Configuration.xsd and click Open.
- Change the value in the Use column to Use this schema. Then click OK.
Link to the article is here , hopes this helps
这篇关于修复:全局元素“配置"已经声明的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!