Сообщения "Не удалось найти схему .." при создании файла nlog.config - PullRequest
0 голосов
/ 09 июля 2020

Когда я создаю файл nlog.config в root своего проекта, я получаю следующие сообщения:

Could not find schema information for the element 'http://www.nlog-project.org/schemas/NLog.xsd:nlog'.  
Could not find schema information for the element 'http://www.nlog-project.org/schemas/NLog.xsd:targets'.       
This is an invalid xsi:type 'http://www.nlog-project.org/schemas/NLog.xsd:File'.    
Could not find schema information for the element 'http://www.nlog-project.org/schemas/NLog.xsd:target'.    
Could not find schema information for the attribute 'name'.     
Could not find schema information for the attribute 'fileName'. 
Could not find schema information for the element 'http://www.nlog-project.org/schemas/NLog.xsd:rules'. 
Could not find schema information for the element 'http://www.nlog-project.org/schemas/NLog.xsd:logger'.    
Could not find schema information for the attribute 'minlevel'.     
Could not find schema information for the attribute 'writeTo'.  

Код, который я использовал, был

        <?xml version="1.0" encoding="utf-8" ?>
    <nlog xmlns="http://www.nlog-project.org/schemas/NLog.xsd"
          xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    
      <!-- the targets to write to -->
      <targets>
        <!-- write logs to file  -->
        <target name="allfile" xsi:type="File"
                fileName="c:\CsharpTutorials\EmployeeManagement\DemoLogs\nlog-all-${shortdate}.log"/>
      </targets>
    
      <!-- rules to map from logger name to target -->
      <rules>
        <!--All logs, including from Microsoft-->
        <logger name="*" minlevel="Trace" writeTo="allfile" />
      </rules>
    </nlog>

I Я следую руководству, и это был код, который использовался. Как исправить проблему?

Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...