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 | 1242 (864) | Ciklamen |
| » | c# seminarskaOddelek: Programiranje | 2998 (2671) | tuned |
| » | [C#] DeserializacijaOddelek: Programiranje | 2046 (1649) | Cvenemir |
| » | [c#] Ustvarjanje objekta v drugem razreduOddelek: Programiranje | 1774 (1719) | Cvenemir |
| » | [c#] Vprašanje glede release verzije aplikacijeOddelek: Programiranje | 1687 (1511) | Ericssony |