I have a windows forms application written in VS2010 with C# and get the following errors in the app.config
file:
Message 4 Could not find schema information for the attribute 'name'
Message 8 Could not find schema information for the attribute 'name'
Message 12 Could not find schema information for the attribute 'name'
Message 5 Could not find schema information for the attribute 'serializeAs'
Message 15 Could not find schema information for the element 'CCP_Utility.Settings1'
Message 2 Could not find schema information for the element 'CCP_Utility.Properties.Settings'
Message 3 Could not find schema information for the element 'setting'
Message 1 Could not find schema information for the element 'userSettings'
Message 6 Could not find schema information for the element 'value'
What do I have to change in the code to fix this issue? Where can I edit what's in CCP_Utility.Settings1
and CCP_Utility.Properties.Settings
?
Here's the app.config
code:
<configuration>
<configSections>
<sectionGroup name="userSettings" type="System.Configuration.UserSettingsGroup, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" >
<section name="CCP_Utility.Properties.Settings" type="System.Configuration.ClientSettingsSection, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" allowExeDefinition="MachineToLocalUser" requirePermission="false" />
<section name="CCP_Utility.Settings1" type="System.Configuration.ClientSettingsSection, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" allowExeDefinition="MachineToLocalUser" requirePermission="false" />
</sectionGroup>
</configSections>
<userSettings>
<CCP_Utility.Properties.Settings>
<setting name="SourceDir" serializeAs="String">
<value />
</setting>
<setting name="TargetDir" serializeAs="String">
<value />
</setting>
<setting name="CorpID" serializeAs="String">
<value />
</setting>
</CCP_Utility.Properties.Settings>
<CCP_Utility.Settings1>
<setting name="sourceDir" serializeAs="String">
<value />
</setting>
<setting name="targetDir" serializeAs="String">
<value />
</setting>
</CCP_Utility.Settings1>
</userSettings>
</configuration>
This error occurs when your project references out of date schemas. Use Visual Studio to generate new ones.
In Visual Studio, do the following:
app.config
orweb.config
file.XML
menu and selectCreate Schema
.App.config
orweb.config
file, right-click in the text-editor and select properties and click the...
button next to the value for Schemas.Add
button.OK
The Could not find schema information for the attribute/element error(s) should now be resolved.
Most of what I write has already been covered by Pressacco, but this is specific to SpecFlow.
I was getting this message for the
<specFlow>
element and therefore I added aspecflow.xsd
file to the solution this answer (with some modifications to allow for the<plugins>
element).Thereafter I (like Pressacco), right clicked within the file buffer of
app.config
and selected properties, and withinSchemas
, I added"specflow.xsd"
to the end. The entirety ofSchemas
now reads:An XSD is included with EntLib 5, and is installed in the Visual Studio schema directory. In my case, it could be found at:
CONTEXT
STEPS TO REMOVE THE WARNINGS
ASIDE
It is worth repeating that these "Error List" "Messages" ("Could not find schema information for the element") are only visible when you open the app.config file. If you "Close All Documents" and compile... no messages will be reported.
When this happened to me (out of nowhere) I was about to dive into the top answer above, and then I figured I'd close the project, close Visual Studio, and then re-open everything. Problem solved. VS bug?
I had this in VS 2012 where the "Section name" had been changed in a project, and I fixed it by deleting "app.config" in the project, then right-clicking on the project in the "Solution Explorer", selecting "Properties", then "Settings", then making a change to one of the settings, saving, and re-building. This created a new app.config with the correct information.
Quickest, easiest laziest way to solve the problem: