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 | 1117 (739) | Ciklamen |
» | c# seminarskaOddelek: Programiranje | 2643 (2316) | tuned |
» | [C#] DeserializacijaOddelek: Programiranje | 1856 (1459) | Cvenemir |
» | [c#] Ustvarjanje objekta v drugem razreduOddelek: Programiranje | 1648 (1593) | Cvenemir |
» | [c#] Vprašanje glede release verzije aplikacijeOddelek: Programiranje | 1475 (1299) | Ericssony |