0

(c#) The error 'The 'configuration' element is not declared.' comes up on my program. It shows it on line 2, which is using System.Collections.Generic;. The program compiles fine, and runs fine But the warning is there, and if its a problem, I want to know what it means. If it is a problem with my code, tell me what it would be (eg. variable declaration), and I can post some code. But my program is ~200 lines, so I would rather not post it here. Is this error coming up because of an error I made? or is it a bug? or is it easily fixable?

Ogoun
  • 61
  • 2
  • 7

2 Answers2

2

SOLVED Visual Studio just needed to be restarted.

Ogoun
  • 61
  • 2
  • 7
-1

It means your app.config or web.config file (depending on what kind of program you're writing) doesn't have a <configuration></configuration> element.

Put the following into your app.config or web.config file:

<configuration xmlns="schemaURL">
   <!-- Your settings here -->
</configuration>
Kirk Woll
  • 76,112
  • 22
  • 180
  • 195
PaulG
  • 6,920
  • 12
  • 54
  • 98
  • That was there, except for xmlns="schemaURL", and after adding that, the warning was gone. Thanks! – Ogoun Jul 23 '14 at 19:52
  • 1
    Sorry, I spoke too soon. After adding that, the compiler failed to run, saying the config was improperly configured. This question is still open – Ogoun Jul 23 '14 at 20:05