C# NLog; Cannot find NLog.xsd file

I fixed the same issue by downloading the schema from "http://www.nlog-project.org/schemas/NLog.xsd" then saving it to my project directory and adding it to the project ...

  • Right click project name in solution explorer.
  • Select Add | Existing item
  • Browse to the new xsd file and select it.

Then the warnings went away.


So, by hoovering with the mouse over the blue underlined line of code in the NLog.config file:

xsi:schemaLocation="http://www.nlog-project.org/schemas/NLog.xsd NLog.xsd"

I realised that Visual Studio was searching for the file 2 folders above my project folder. The solution was that the parent folder of my project folder had a "#" in its name! Thereby apparently preventing VS from finding the config file. After removing the "#" the warning disappeared and I could use intellisense again.


This worked for me in visual studio.

  • Go to Project -> Manage NuGet Packages -> Browse for NLog.Schema
  • Install it

Tags:

C#

Xsd

Nlog