12

I get the following error:

The global element 'http://www.nlog-project.org/schemas/NLog.xsd:nlog' has already been declared.

And a lot of the following errors with different types:

The complexType 'http://www.nlog-project.org/schemas/NLog.xsd:NLogConfiguration' has already been declared.

The simpleType 'http://www.nlog-project.org/schemas/NLog.xsd:NLogLevel' has already been declared.

I have the following nuget packages installed:

  • NLog
  • NLog Configuration
  • NLog Schema for Intellisense(TM)
david.s
  • 11,283
  • 6
  • 50
  • 82

3 Answers3

32

After checking in menu XML > Schemas I realized I had more references to the same schema, so I disabled one of them and this solved the problem.

enter image description here

david.s
  • 11,283
  • 6
  • 50
  • 82
  • Where is this menu item in VS 2013? – Grault Mar 03 '15 at 20:23
  • 4
    @Jesdisciple, you will find the menu item in Visual Studio 2013 as david.s explains; XML -> Schemas. If you cannot see this menu item it is probably because your current/active document is not a XML document. Try to open and focus a XML document (e.g. a NLog.config file) then you will see the menu item. – Casper Taylor Korshøj Jun 09 '15 at 12:14
  • 1
    @CasperTaylorKorshøj Aha, thanks. Note to self: Avoid phantom menus. – Grault Jun 11 '15 at 21:29
6
<nlog autoReload="true" 
  xmlns="http://www.nlog-project.org/schemas/NLog.xsd"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
  xsi:schemaLocation="http://www.nlog-project.org/schemas/NLog.xsd ..\Config\NLog.xsd">
...
</nlog>
yongfa365
  • 352
  • 3
  • 7
3

Fixed this problem by installing NLog.config (don't confuse with actual NLog) package from NuGet.

Eternal21
  • 4,190
  • 2
  • 48
  • 63