修复:全局元素“配置"已被声明

Fix: The Global element #39;configuration#39; has already been declared(修复:全局元素“配置已被声明)
本文介绍了修复:全局元素“配置"已被声明的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用了第二种解决方案如何解决可以找不到元素/属性 >" 的架构信息?

即使用按钮创建了一个 XSD 以创建方案.我将 app.config 中的样式表更改为 app.xsd 但现在我收到警告:

全局元素配置"已在 app.xsd 中声明

即使更改名称也会显示警告.有人对此有解决方案吗?

解决方案

我遇到了与您提到的问题类似的问题,我按照这些说明进行操作,一切都很好.首先确保 EnterpriseLibrary.Configuration.xsd%ProgramFiles%Microsoft Visual Studio [version]XmlSchemas 中,然后执行以下操作:

<块引用>

Enterprise Library 将架构安装到 Visual Studio 中,该架构提供 IntelliSense® 以在 Visual Studio XML 编辑器中编辑 Enterprise Library 配置文件.您必须先打开架构,然后才能使用它.

<块引用>

启用企业库配置架构

<块引用>

  1. 在解决方案资源管理器中双击配置文件,在 Visual Studio 中打开它.

<块引用>

  1. 在 XML 菜单上,单击 Schemas... 打开 XML Schemas 对话框.

<块引用>

  1. 找到名为 EnterpriseLibrary.Configuration.xsd 的架构.这是自动安装的.但是,如果它未显示在列表中,请单击添加并导航到文件夹 %Program Files%Microsoft Visual Studio [version] XmlSchemas,然后选择 EnterpriseLibrary.Configuration.xsd 并单击打开.

<块引用>

  1. 将使用列中的值更改为使用此架构.然后点击确定.

文章的链接是这里 ,希望对您有所帮助

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]XmlSchemas 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

  1. Open the configuration file in Visual Studio by double-clicking it in Solution Explorer.

  1. On the XML menu, click Schemas... to open the XML Schemas dialog.

  1. 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] XmlSchemas, then select EnterpriseLibrary.Configuration.xsd and click Open.

  1. Change the value in the Use column to Use this schema. Then click OK.

Link to the article is here , hopes this helps

这篇关于修复:全局元素“配置"已被声明的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!

本站部分内容来源互联网,如果有图片或者内容侵犯您的权益请联系我们删除!

相关文档推荐

DispatcherQueue null when trying to update Ui property in ViewModel(尝试更新ViewModel中的Ui属性时DispatcherQueue为空)
Drawing over all windows on multiple monitors(在多个监视器上绘制所有窗口)
Programmatically show the desktop(以编程方式显示桌面)
c# Generic Setlt;Tgt; implementation to access objects by type(按类型访问对象的C#泛型集实现)
InvalidOperationException When using Context Injection in ASP.Net Core(在ASP.NET核心中使用上下文注入时发生InvalidOperationException)
LINQ many-to-many relationship, how to write a correct WHERE clause?(LINQ多对多关系,如何写一个正确的WHERE子句?)