如何解决"无法找到元素/属性&LT架构信息,XXX>"? [英] How to resolve "Could not find schema information for the element/attribute <xxx>"?

查看:590
本文介绍了如何解决"无法找到元素/属性&LT架构信息,XXX>"?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在Visual Studio中,我有一个asp.net 3.5的项目,在使用MS企业库4.0应用程序块。

In visual studio, I have an asp.net 3.5 project that is using MS Enterprise Library 4.0 application blocks.

当我有我的Web配置文件打开,我的错误列表填充了99条信息了这些东西,

When I have my web config file open, my Error list fills up with 99 messages with things like

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文件,他们走开(但他们回来,只要我需要再次打开该文件)。

If I close the Web.config file they go away (but they come back as soon as I need to open the file again).

做了一些照顾,我发现这是becauase有一个XSD或模式文件缺少Visual Studio的需要,以便正确地理解也就是在web.config文件的架构,并为它提供了智能感知。

After doing some looking, I found that this is becauase there is an XSD or schema file missing that Visual Studio needs in order to properly 'understand' the schema that is in the web.config file and provide intellisense for it.

有谁知道如何任一电源VS与适当的架构信息,或关闭这些信息?

Does anyone know how to either supply VS with the appropriate schema information, or to turn off these messages?

@Franci - 感谢您的信息,我已经尝试了这个工具,以及在(他们往往要炸掉格式在Web.config)的MMC管理单元,但他们仍然没有解决,我收到了刺激性的警告。感谢您试用。

@Franci - Thanks for the info, I have tried that tool as well as the MMC snap in (they tend to blow up the formatting in the Web.config) but they still do not resolve the irritating warnings I receive. Thanks for trying.

推荐答案

我配置了EntLib配置工具中的app.config并成立了我的LoggingConfiguration块。然后我复制到DotNetConfig.xsd这一点。当然,这并不包括所有的属性,只有那些我补充,但它并没有显示这些烦人的信息消息了。

I configured the app.config with the tool for EntLib configuration and set up my LoggingConfiguration block. Then i copied this into the DotNetConfig.xsd. Of course it does not cover all attributes, only the ones I added but it does not display those annoying info messages any more.

<xs:element name="loggingConfiguration">
      <xs:complexType>
        <xs:sequence>
          <xs:element name="listeners">
            <xs:complexType>
              <xs:sequence>
                <xs:element maxOccurs="unbounded" name="add">
                  <xs:complexType>
                    <xs:attribute name="fileName" type="xs:string" use="required" />
                    <xs:attribute name="footer" type="xs:string" use="required" />
                    <xs:attribute name="formatter" type="xs:string" use="required" />
                    <xs:attribute name="header" type="xs:string" use="required" />
                    <xs:attribute name="rollFileExistsBehavior" type="xs:string" use="required" />
                    <xs:attribute name="rollInterval" type="xs:string" use="required" />
                    <xs:attribute name="rollSizeKB" type="xs:unsignedByte" use="required" />
                    <xs:attribute name="timeStampPattern" type="xs:string" use="required" />
                    <xs:attribute name="listenerDataType" type="xs:string" use="required" />
                    <xs:attribute name="traceOutputOptions" type="xs:string" use="required" />
                    <xs:attribute name="filter" type="xs:string" use="required" />
                    <xs:attribute name="type" type="xs:string" use="required" />
                    <xs:attribute name="name" type="xs:string" use="required" />
                  </xs:complexType>
                </xs:element>
              </xs:sequence>
            </xs:complexType>
          </xs:element>
          <xs:element name="formatters">
            <xs:complexType>
              <xs:sequence>
                <xs:element name="add">
                  <xs:complexType>
                    <xs:attribute name="template" type="xs:string" use="required" />
                    <xs:attribute name="type" type="xs:string" use="required" />
                    <xs:attribute name="name" type="xs:string" use="required" />
                  </xs:complexType>
                </xs:element>
              </xs:sequence>
            </xs:complexType>
          </xs:element>
          <xs:element name="logFilters">
            <xs:complexType>
              <xs:sequence>
                <xs:element name="add">
                  <xs:complexType>
                    <xs:attribute name="enabled" type="xs:boolean" use="required" />
                    <xs:attribute name="type" type="xs:string" use="required" />
                    <xs:attribute name="name" type="xs:string" use="required" />
                  </xs:complexType>
                </xs:element>
              </xs:sequence>
            </xs:complexType>
          </xs:element>
          <xs:element name="categorySources">
            <xs:complexType>
              <xs:sequence>
                <xs:element maxOccurs="unbounded" name="add">
                  <xs:complexType>
                    <xs:sequence>
                      <xs:element name="listeners">
                        <xs:complexType>
                          <xs:sequence>
                            <xs:element name="add">
                              <xs:complexType>
                                <xs:attribute name="name" type="xs:string" use="required" />
                              </xs:complexType>
                            </xs:element>
                          </xs:sequence>
                        </xs:complexType>
                      </xs:element>
                    </xs:sequence>
                    <xs:attribute name="switchValue" type="xs:string" use="required" />
                    <xs:attribute name="name" type="xs:string" use="required" />
                  </xs:complexType>
                </xs:element>
              </xs:sequence>
            </xs:complexType>
          </xs:element>
          <xs:element name="specialSources">
            <xs:complexType>
              <xs:sequence>
                <xs:element name="allEvents">
                  <xs:complexType>
                    <xs:attribute name="switchValue" type="xs:string" use="required" />
                    <xs:attribute name="name" type="xs:string" use="required" />
                  </xs:complexType>
                </xs:element>
                <xs:element name="notProcessed">
                  <xs:complexType>
                    <xs:attribute name="switchValue" type="xs:string" use="required" />
                    <xs:attribute name="name" type="xs:string" use="required" />
                  </xs:complexType>
                </xs:element>
                <xs:element name="errors">
                  <xs:complexType>
                    <xs:sequence>
                      <xs:element name="listeners">
                        <xs:complexType>
                          <xs:sequence>
                            <xs:element name="add">
                              <xs:complexType>
                                <xs:attribute name="name" type="xs:string" use="required" />
                              </xs:complexType>
                            </xs:element>
                          </xs:sequence>
                        </xs:complexType>
                      </xs:element>
                    </xs:sequence>
                    <xs:attribute name="switchValue" type="xs:string" use="required" />
                    <xs:attribute name="name" type="xs:string" use="required" />
                  </xs:complexType>
                </xs:element>
              </xs:sequence>
            </xs:complexType>
          </xs:element>
        </xs:sequence>
        <xs:attribute name="name" type="xs:string" use="required" />
        <xs:attribute name="tracingEnabled" type="xs:boolean" use="required" />
        <xs:attribute name="defaultCategory" type="xs:string" use="required" />
        <xs:attribute name="logWarningsWhenNoCategoriesMatch" type="xs:boolean" use="required" />
      </xs:complexType>
    </xs:element>

这篇关于如何解决&QUOT;无法找到元素/属性&LT架构信息,XXX&GT;&QUOT;?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆