Questions tagged [configurationelement]
27 questions
1
vote
1 answer
Get ConfigurationElement parent in app.config
I have created a custom ConfigurationSection, ConfigurationElement(s) and ConfigurationElementCollection(s) for my app.config, it's based on this documentation.
Now I would like to be able to access a parent element in any configuration element.
For…

NixonUposseen
- 53
- 3
- 12
1
vote
1 answer
Using AutoMapper to Map List
I am having a bit of a problem using AutoMapper with some Configuration Elements.
I have the following classes:
public class SocialLinkSettingConfiguration : ConfigurationSection
{
[ConfigurationProperty("name", IsRequired = true, IsKey =…

Ben Haynie
- 115
- 9
1
vote
1 answer
ConfigurationElement set null default value
I have a small problem with a custom configuration section in App.config.
The problem is: I have a CustomElement (let's call it 'a') whose properties CustomElement another (let's call it 'b').
I would like to have b as a value not null only if…

Luigi Russo
- 105
- 6
1
vote
1 answer
intercept configurationelement set
I want to set a configurationelement property when another property is set. I load configuration element with a getsection and the set function is apparently not fired.
code:
[ConfigurationProperty("type", DefaultValue = "String", IsRequired =…

JD11
- 306
- 3
- 11
1
vote
1 answer
How to check either both properties or none of them are present in configuration element?
Is there way to write some ConfigurationValidatorAttribute or in some other way that will allow either both Prop1 and Prop2 are present or none of them?
EDITED
In the following config file when I'll try to get Domains I want to get runtime exception…

theateist
- 13,879
- 17
- 69
- 109
0
votes
0 answers
Add new ConfigurationElement in ConfigurationElementCollection throws Read-only exception
I have a .config file, where i need to add new ConfigurationElement under the ConfigurationElementCollection, I have followed the documentation of microsoft and implemented everything…

Dharun
- 15
- 7
0
votes
0 answers
.NET Custom Configuration object type based on attribute value
I'm working on a custom configuration section for a custom application, attempting to make the functionality more easily extensible. I've got an extension mechanism finished up for one part, to create a specific configuration type based on the…

Theo Brinkman
- 291
- 2
- 10
0
votes
1 answer
WCF BehaviorExtensionElement nested properties in SVCEditor
I have created CustomBehaviorExtensionElement and CustomEndpointBehavior for custom Message.
public class CustomEndpointBehavior : IEndpointBehavior
{
private X509Certificate2 certificate;
public X509Certificate2 Certificate { get =>…

Andrew
- 1
0
votes
0 answers
ListView.SelectedItem does not change when the property of the bound ConfigurationElement has changed
I have a class derived from ConfigurationElement as follows:
public class Item : ConfigurationElement, INotifyPropertyChanged
{
// Binding Properties.
[ConfigurationProperty("Name", DefaultValue = null, IsRequired = true)]
public string…

Noctis Tong
- 459
- 1
- 7
- 17
0
votes
2 answers
Weird error while accessing an element in a ConfigurationElementCollection
I have a ConfigurationSection with a ConfigurationElementCollection like below:
…

usp
- 797
- 3
- 10
- 24
0
votes
2 answers
Store same key in Machine.config and App.config
I'm holding a custom configuration section in machine.config of following structure:
Now, i want to be able to override the same key settings…

Uri Abramson
- 6,005
- 6
- 40
- 62
0
votes
1 answer
overriding/replacing ConfigurationElements in app.config in runtime
I have two ConfigurationElement objects (one of which is in the running application's app.config) and I need to replace that one with the other. I also have the ConfigurationElementCollection that the first element belongs to. It looks like the Add…

user981225
- 8,762
- 6
- 32
- 41