How to resolve "Could not find schema information for the element/attribute <xxx>"?

StingyJack picture StingyJack · Oct 7, 2008 · Viewed 148.2k times · Source

In visual studio, I have an asp.net 3.5 project that is using MS Enterprise Library 4.0 application blocks.

When I have my web config file open, my Error list fills up with 99 messages with things like

Could not find schema information for the element 'dataConfiguration'.  
Could not find schema information for the attribute 'defaultDatabase'.  
Could not find schema information for the element 'loggingConfiguration'.   
Could not find schema information for the attribute 'tracingEnabled'.   
Could not find schema information for the attribute 'defaultCategory'.  

If I close the Web.config file they go away (but they come back as soon as I need to open the file again).

After doing some looking, I found that this is becauase there is an XSD or schema file missing that Visual Studio needs in order to properly 'understand' the schema that is in the web.config file and provide intellisense for it.

Does anyone know how to either supply VS with the appropriate schema information, or to turn off these messages?

@Franci - Thanks for the info, I have tried that tool as well as the MMC snap in (they tend to blow up the formatting in the Web.config) but they still do not resolve the irritating warnings I receive. Thanks for trying.

Answer

user57433 picture user57433 · Jan 21, 2009

I've created a new scheme based on my current app.config to get the messages to disappear. I just used the button in Visual Studio that says "Create Schema" and an xsd schema was created for me.

Save the schema in an apropriate place and see the "Properties" tab of the app.config file where there is a property named Schemas. If you click the change button there you can select to use both the original dotnetconfig schema and your own newly created one.