C# – in app.config Could not find schema information for the element ‘userSettings’

app-configcschemasettings.settings

Hello when I try to add parameters to the settings table
I get multiple messages for each parameter I add.

e.g.:

  • Could not find schema information for
    the element 'userSettings'

  • Could not find schema information for
    the element 'setting'

  • Could not find schema information for
    the attribute 'serializeAs'

In the app.config I get:

<project1.Properties.Settings>
   <setting name="ccc" serializeAs="String">
      <value>vvv</value>
    </setting>
</project1.Properties.Settings>

I can use, edit and save this parameter, but the messages really annoy me.

I use the following schema (and selecting other like 20 and 30 did not help):

C:\Program Files (x86)\Microsoft Visual Studio 9.0\xml\Schemas\DotNetConfig.xsd

Any ideas?

edit:
following Hans post here is my configSections

<configSections>
    <sectionGroup name="userSettings" type="System.Configuration.UserSettingsGroup, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" >
      <section name="project1.Properties.Settings" type="System.Configuration.ClientSettingsSection, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" allowExeDefinition="MachineToLocalUser" requirePermission="false" />
    </sectionGroup>
  </configSections>

I don't know what it is for and if I should change it – yet here it is 🙂

Thanks Asaf

Best Answer

Well, that doesn't look healthy. Note how it is not valid XML, the project... element is mismatched with RuthSiteManager...

Not sure how it got that way, you'll have to edit it into shape. I guess you want to rename "project1". Avoid editing the .config file by hand otherwise. And make sure you have the required <configSections> element as well.