none
could not find schema information

    Question

  • Hi all,

           I have WCF webservice and the project contains configuration App.config file containing my custom configuration options in <configsections> for the webservice. 

    I have two custom settings for the webservice. One is in a <sectiongroup> element and the other is a <section> element, with types NameValueSectionHandler and SingleTagSectionHandler respectively.  Now the documentation does not say I should have custom types for custom settings. I get errors "could not find schema information for the element <settings name here>". This is a .net 4.0 project using VS 2010.  I have some settings in the <appSettings> elements which works fine with any errors. What is going wrong here ????

    <section name="NumberPatterns" type="System.Configuration.NameValueSectionHandler, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
    
    <section name="Provider" type="System.Configuration.SingleTagSectionHandler, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
    
    Monday, May 09, 2011 2:42 PM

Answers

  • This warning is simply telling you that VS can not validate the information in your config sections against a defined schema. It has no way to know whether it is formatted correctly or not. It should not prevent you from running your application, it's just a warning.

    If you want to, you can create a schema file and add the namespace to your config namespace section:

    <configuration xmlns="mySchema" xmlns:xsi = "http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="mySchema <URI to xsd file">
    
    • Marked as answer by free.fly Monday, May 09, 2011 3:13 PM
    Monday, May 09, 2011 3:01 PM

All replies

  • This warning is simply telling you that VS can not validate the information in your config sections against a defined schema. It has no way to know whether it is formatted correctly or not. It should not prevent you from running your application, it's just a warning.

    If you want to, you can create a schema file and add the namespace to your config namespace section:

    <configuration xmlns="mySchema" xmlns:xsi = "http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="mySchema <URI to xsd file">
    
    • Marked as answer by free.fly Monday, May 09, 2011 3:13 PM
    Monday, May 09, 2011 3:01 PM
  • Hi

      Thanks for your reply. Why do the <appSettings> element work and the one I wrote doesn't... my point is.. both of them uses the built in types from the .net framework. Can you please explain why do we have such behaviour ? the documentation does not say any thing related to xsd files when creating custom settings with NameValueSectionHandler or singleTagSectionHandler.

    Can I write my own configuration element type by extending in code ? will this approach work ? I am not familiar with the creating schemas, but I will look into it.

    Monday, May 09, 2011 3:13 PM
  • In <appSettings>, you are just creating instances of your type. You're not defining new types. The configuration settings under you elements in <appSettings> are not being validated, but the error is reported where you declare the type, not where it is used.

    As for why VS can't find the schemas for their built-in types, that's been going around for awhile. If you do a google search, you'll see a lot of people with the exact same problem you're having. There are more detailed instructions about how you can make the messages go away here.

    Monday, May 09, 2011 3:42 PM