Jak rozwiązać problem "nie można znaleźć informacji o schemacie dla elementu / atrybutu"?

W visual studio mam asp.net 3.5 projekt wykorzystujący bloki aplikacji MS Enterprise Library 4.0.

Kiedy mam otwarty plik konfiguracyjny, Moja Lista błędów wypełnia się 99 wiadomościami takimi jak

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'.  
Jeśli zamknę sieć.plik konfiguracyjny znikają (ale wracają, gdy tylko muszę ponownie otworzyć plik).

Po zrobieniu trochę patrząc, okazało się, że to dlatego, że brakuje pliku XSD lub schematu, który Visual Studio potrzebuje, aby prawidłowo "zrozumieć" schemat, który jest w sieci.plik konfiguracyjny i dostarczyć intellisense dla niego.

Czy ktoś wie jak albo podać odpowiednie informacje o schemacie, albo wyłączyć te wiadomości?

@Franci-dzięki za info, próbowałem tego narzędzia, jak również MMC snap in (mają tendencję do wysadzania formatowania w Internecie.config), ale nadal nie rozwiązują irytujących ostrzeżeń, które otrzymuję. Dzięki, że próbowałeś.

Author: David Gardiner, 2008-10-07

6 answers

Skonfigurowałem app.config za pomocą narzędzia do konfiguracji EntLib i skonfigurowałem mój LoggingConfiguration blok. Potem skopiowałem to do DotNetConfig.xsd. Oczywiście nie obejmuje wszystkich atrybutów, tylko te, które dodałem, ale nie wyświetla już tych irytujących wiadomości informacyjnych.

<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>
 11
Author: user57433,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/doraprojects.net/template/agent.layouts/content.php on line 54
2018-09-18 00:20:00

Stworzyłem nowy schemat oparty na mojej obecnej aplikacji.config, aby wiadomości zniknęły. Po prostu użyłem przycisku w Visual Studio, który mówi "Create Schema" i schemat xsd został stworzony dla mnie.

Zapisz schemat w odpowiednim miejscu i zobacz zakładkę "Właściwości" aplikacji.plik konfiguracyjny, w którym znajduje się właściwość o nazwie Schemas. Po kliknięciu przycisku Zmień można wybrać, aby użyć zarówno oryginalnego schematu dotnetconfig, jak i własnego nowo utworzonego.

 30
Author: user57433,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/doraprojects.net/template/agent.layouts/content.php on line 54
2012-03-30 11:34:48

XSD jest dołączony do EntLib 5 i jest instalowany w katalogu Visual Studio schema. W moim przypadku można go znaleźć pod adresem:

"C:\Program Files (x86) \ Microsoft Visual Studio 10.0 \ XML \ Schemas\EnterpriseLibrary.Konfiguracja.xsd "

Kontekst

  • Visual Studio 2010
  • Enterprise Library 5

KROKI USUWANIA OSTRZEŻEŃ

  1. otwórz aplikację.config w projekcie Visual Studio
  2. Kliknij prawym przyciskiem myszy w edytorze dokumentów XML, wybierz "Właściwości"
  3. Dodaj w pełni kwalifikowaną ścieżkę do " EnterpriseLibrary.Konfiguracja.xsd "

Na bok

Warto powtórzyć, że te" listy błędów "" komunikaty "("nie można znaleźć informacji o schemacie dla elementu") są widoczne tylko po otwarciu aplikacji.plik konfiguracyjny. Jeśli "zamkniesz wszystkie dokumenty" i skompilujesz... nie będą zgłaszane żadne wiadomości.

 13
Author: Pressacco,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/doraprojects.net/template/agent.layouts/content.php on line 54
2017-07-30 14:57:17

Próbowałeś skopiować plik schematu do folderu buforowania schematu XML dla VS? Możesz znaleźć lokalizację tego folderu, patrząc na VS Tools/Options/Test Editor/XML / Miscellaneous. Niestety nie wiem gdzie jest plik schematu dla biblioteki MS Enterprise 4.0.

Update: Po zainstalowaniu biblioteki ms Enterprise wydaje się, że nie maplik xsd. Istnieje jednak narzędzie do edycji konfiguracji-EntLibConfig.exe, za pomocą którego można edytować konfigurację pliki. Ponadto, jeśli dodasz odpowiednie sekcje konfiguracyjne do pliku konfiguracyjnego, VS powinien być w stanie poprawnie przeanalizować plik konfiguracyjny. (EntLibConfig doda je za Ciebie lub możesz dodać je samodzielnie). Oto przykład dla sekcji loggingConfiguration:

<configSections>
    <section name="loggingConfiguration" type="Microsoft.Practices.EnterpriseLibrary.Logging.Configuration.LoggingSettings, Microsoft.Practices.EnterpriseLibrary.Logging, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
</configSections>

Musisz również dodać odniesienie do odpowiedniego zespołu w swoim projekcie.

 1
Author: Franci Penov,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/doraprojects.net/template/agent.layouts/content.php on line 54
2008-10-07 21:04:20

Co Naprawiono "nie można znaleźć informacji o schemacie dla elementu ..."dla mnie było

  • otwieram moje app.config.
  • kliknięcie prawym przyciskiem myszy w oknie Edytora i wybranie Properties.
  • w polu Właściwości znajduje się wiersz o nazwie Schemas, kliknąłem ten wiersz i wybrałem okno przeglądaj ..., które pojawia się w wierszu.
  • po prostu zaznaczyłem use pole dla wszystkich wierszy, które miały gdzieś mój projekt, a także dla bieżącej wersji. Net, której używałem. Na instancja: DotNetConfig30.xsd.

Potem wszystko zaczęło działać dobrze.

Jak te rzędy schematu z moim projektem zostały odznaczone nie jestem pewien, ale kiedy upewniłem się, że zostały sprawdzone, wróciłem do gry.

 1
Author: Wade Price,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/doraprojects.net/template/agent.layouts/content.php on line 54
2015-03-28 19:58:03

Przejdź do tego: NLog XSD files

Pobierz odpowiedni xsd dla swojego projektu i zapisz go na Nlogu.config

Pierwszy zrobił sztuczkę dla mnie.

 0
Author: darkmatter,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/doraprojects.net/template/agent.layouts/content.php on line 54
2014-07-04 13:27:56