What validates elements and attributes in config files?
January 20, 2011
Posted by on
While editing a config file, we can noticed error messages if we misspell or place wrong elements/attributes. We can also notice intellisense popping out to help us.
While the config file is an xml what can possibly validate the nodes and what can provide intellisense help?
Visual studio usually comes with an XSD file named DotNetConfig.xsd.
This schema file is used by the Visual studio to validate the config file entry. Providing help (through intellisense) while editing an XML is a regular feature provided by Visual Studio, if it finds a valid XSD file.
The DotNetConfig.xsd can be found in “C:\Program Files (x86)\Microsoft Visual Studio 10.0\Xml\Schemas” usually. (Replace the Visual Studio folder name based on the version of Visual studio being used)
Visual Studio 2010, provides support for working on all (almost) the previous versions of .net. i.e Framework 2.0, 3.0, 3.5 and 4.0.
So for validating configs when we work in different versions of framework, different versions of xsd files are provided.
DotNetConfig.xsd (This is for the default framework i.e. Framework 4.0)