Forum » Programska oprema » c# ConfigSection
c# ConfigSection
detroit ::
Delam config section v app.configu
v app.configu imam
to je nek class pač in v glavnem classu
Ta zadnja vrstica vrne Configuration system failed to initialize. Ali kdo opazi kako napako
v app.configu imam
<configSections> <section name="AConfigSection" type="TestGJILoad.AConfigSection, TestGJILoad"/> </configSections> <AConfigSection> <UrlElement name="FCL1 oz kaj pa vem" url="www.abc.com"/> </AConfigSection>
using System.Configuration; namespace TestGJILoad { public class UrlElement : ConfigurationElement { [ConfigurationProperty("name", IsRequired = true)] public string Name { get { return (string)this["name"]; } set { this["name"] = value; } } [ConfigurationProperty("url")] public string Url { get { return (string)this["url"]; } set { this["url"] = value; } } } public class AConfigSection : ConfigurationSection { [ConfigurationProperty("url")] public UrlElement AUrl { get { return (UrlElement)this["url"]; } set { this["url"] = value; } } } }
to je nek class pač in v glavnem classu
AConfigSection config = (AConfigSection)System.Configuration.ConfigurationManager.GetSection("AConfigSection");
Ta zadnja vrstica vrne Configuration system failed to initialize. Ali kdo opazi kako napako
Skero
- spremenil: detroit ()
Vredno ogleda ...
Tema | Ogledi | Zadnje sporočilo | |
---|---|---|---|
Tema | Ogledi | Zadnje sporočilo | |
» | [C#] WPF vprašanjaOddelek: Programiranje | 1121 (743) | Ciklamen |
» | c# seminarskaOddelek: Programiranje | 2648 (2321) | tuned |
» | [C#] DeserializacijaOddelek: Programiranje | 1859 (1462) | Cvenemir |
» | [c#] Ustvarjanje objekta v drugem razreduOddelek: Programiranje | 1653 (1598) | Cvenemir |
» | [c#] Vprašanje glede release verzije aplikacijeOddelek: Programiranje | 1482 (1306) | Ericssony |