When developing ASP.NET MVC applications one runs from time to time into errors related to the Web.config configuration. This is not weird: in the end Web.config is an XML file and it´s easy to make silly mistakes when editing it:  tags that do not close correctly, sections one forgets to comment – or to un-comment -, etc.

Such errors are usually simple to correct, except that the resulting message error is usually anything but helpful and sometimes even misleading.

Take this one example:

The configuration section system.identityModel cannot be read because it is missing a section declaration

In my particular case the error occured at this part in my Web.Config configuration:

identity model section

The message error was simply talking about a missing section: it was not very specific although it pointed – at least – in the right direction.

The missing section was this part of the Web.config that I had forgotten to un-comment:

missing section

Once I un-commented it the error went away.