Reputation: 1049
I have been trying to work with app.config sections by this example:
and its giving me the next exception:
An error occurred creating the configuration section handler for MyUrls:
Could not load file or assembly 'ConfigurationCollectionAttribute, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. The system cannot find the file specified. (E:\Projects\AppConfigSectionsTesting\AppConfigSectionsTesting\bin\Debug\AppConfigSectionsTesting.vshost.exe.Config line 4)
this is the config file -
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<configSections>
<section name="MyFolders" type="FoldersSection,
ConfigurationCollectionAttribute, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null" />
</configSections>
<MyFolders>
<Folders>
<add Path ="D:\\RUN"/>
</Folders>
</MyFolders>
</configuration>
i dont understand why.... can anyone help? thank you.
Upvotes: 4
Views: 1323
Reputation: 13221
In your app.config, check that you've got the full namespace to the class ConfigurationCollectionAttribute
For example:
<configSections>
<section name="configSectionName"
type="Company.Namespace.ConfigSection, Company.Namespace" />
</configSections>
Upvotes: 3