Note that there are some explanatory texts on larger screens.

plurals
  1. POApp.Config Custom configuration section problem
    primarykey
    data
    text
    <p>I've created a custom config section for my application. For some reason Visual Studio 2010 isn't picking up and of my custom properties. I'm getting warnings similar to this for all the "add" keys:</p> <pre><code>Could not find schema information for the element 'urlFilterSection' </code></pre> <p><strong>CONFIG FILE:</strong></p> <pre><code>&lt;configSections&gt; &lt;section name="urlFilterSection" type="BotFinderApp.Models.UrlFilterSection, BotFinder" /&gt; &lt;/configSections&gt; &lt;urlFilterSection&gt; &lt;urlFilterCollection&gt; &lt;add url="urlhere.com.au" numberOfIpsToExtract="10" /&gt; &lt;add url="urlhere.com.au" numberOfIpsToExtract="10" /&gt; &lt;add url="urlhere.com.au" numberOfIpsToExtract="10" /&gt; &lt;add url="urlhere.com.au" numberOfIpsToExtract="10" /&gt; &lt;add url="urlhere.com.au" numberOfIpsToExtract="10" /&gt; &lt;add url="urlhere.com.au" numberOfIpsToExtract="10" /&gt; &lt;add url="urlhere.com.au" numberOfIpsToExtract="10" /&gt; &lt;add url="urlhere.com.au" numberOfIpsToExtract="10" /&gt; &lt;add url="urlhere.com.au" numberOfIpsToExtract="10" /&gt; &lt;/urlFilterCollection&gt; &lt;/urlFilterSection&gt; </code></pre> <p><strong>UrlFilterSection:</strong></p> <pre><code>namespace BotFinderApp.Models { public class UrlFilterSection : ConfigurationSection { public UrlFilterSection() { } [ConfigurationProperty("urlFilterCollection", IsDefaultCollection = false)] [ConfigurationCollection(typeof(UrlFilterCollection), AddItemName = "add", ClearItemsName = "clear", RemoveItemName = "remove")] public UrlFilterCollection Urls { get { var urlsCollection = (UrlFilterCollection)base["urlFilterCollection"]; return urlsCollection; } } } } </code></pre> <p><strong>UrlFilterCollection</strong></p> <pre><code>namespace BotFinderApp.Models { public class UrlFilterCollection : ConfigurationElementCollection { public UrlFilterCollection() { } protected override ConfigurationElement CreateNewElement() { return new UrlFilter(); } protected override object GetElementKey(ConfigurationElement element) { return ((UrlFilter)element).Url; } } } </code></pre> <p><strong>UrlFilter</strong></p> <pre><code>namespace BotFinderApp.Models { public class UrlFilter : ConfigurationElement { public UrlFilter() { } [ConfigurationProperty("url", DefaultValue = "", IsRequired = true)] public string Url { get { return (string)this["url"]; } set { this["url"] = value; } } [ConfigurationProperty("numberOfIpsToExtract", DefaultValue = "0", IsRequired = true)] public int NumberOfIpsToExtract { get { return (int)this["numberOfIpsToExtract"]; } set { this["numberOfIpsToExtract"] = value; } } } } </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload