Questions tagged [custom-configuration]

75 questions
33
votes
4 answers

ConfigurationElementCollection and Linq

I've written some custom configuration collections, elements etc. Now, I'd like to do a simple Linq statement: ServerDetails servers = ConfigurationManager.GetSection("serverDetails") as ServerDetails; var server = from s in servers …
Neil Knight
  • 47,437
  • 25
  • 129
  • 188
24
votes
1 answer

Moving a custom configuration group to a separate file

I've recently wrote a rather large custom configuration group. I'm curious if it is possible to move this configuration to a separate file via the following:
Alexis Abril
  • 6,389
  • 6
  • 33
  • 53
17
votes
3 answers

Custom Config section in App.config C#

I'm a quite beginner with config sections in c# I want to create a custom section in config file. What I've tried after googling is as the follows Config file:
Chaturvedi Dewashish
  • 1,469
  • 2
  • 15
  • 39
16
votes
1 answer

How do I make my custom config section behave like a collection?

How would I need to write my custom ConfigurationSection so that it is both a section handler and a configuration element collection? Normally, you have one class that inherits from ConfigurationSection, which then has a property that is of a type…
theBoringCoder
  • 233
  • 2
  • 14
10
votes
4 answers

How to read this custom configuration from App.config?

How to read this custom configuration from App.config? Rather…
user366312
  • 16,949
  • 65
  • 235
  • 452
10
votes
3 answers

ConfigurationElementCollection with a number of ConfigurationElements of different type

Is it possible to have a CollectionElementCollection with a number of different by type CollectionElements, e.g.:
abatishchev
  • 98,240
  • 88
  • 296
  • 433
9
votes
1 answer

Unrecognized element exception with custom C# config

I have the following bits in App.config for a .NET 3.5 Windows Service:
Mike
  • 6,149
  • 5
  • 34
  • 45
7
votes
2 answers

Is there any way to access the value of custom config section using the key as in AppSettings?

I have a customized config section in my web.config like this:
Xavier
  • 1,672
  • 5
  • 27
  • 46
7
votes
4 answers

Custom configuration files - Play! Framework 2.0

I have a question about loading properties from custom configuration files. I have tried two different approaches to loading my oauth.properties file but I can't get either to work so I'm hoping someone here can help me. The first approach I tried…
travega
  • 8,284
  • 16
  • 63
  • 91
6
votes
1 answer

How to create nested custom configuration section in c#?

I need custom configuration in following way I am not finding any example of how to do that. Following comes very…
Tilak
  • 30,108
  • 19
  • 83
  • 131
5
votes
2 answers

TestNG: how do I run a custom TestNG.XML File programmatically

I browsed through several different threads and websites (as well as the TestNG API) looking for how to run and create custom tests. I haven't found (or not understood) how I can run a custom testng.xml (test suite) programmatically. I have created…
4
votes
2 answers

Recursive Custom Configuration in c#

I am trying to create a custom configuration section that follows the following recursive structure:
4
votes
3 answers

Read web.config section to List

I have this in a web.config : I'd like read the all section "MySection" and get all value to a List (ex…
TheBoubou
  • 19,487
  • 54
  • 148
  • 236
4
votes
1 answer

How to determine "ConfigurationElement" is available on "ConfigurationSection" custom configuration settings

I have written a custom configuration for my application but I am not getting proper way to determine if any ConfigurationElement not present in ConfigurationSection. this is my custom configuration app.config code
4
votes
2 answers

When is using the section preferable to a custom configuration section?

When creating my application's or library's configuration, I generally prefer using a custom configuration section over the section for the following reasons. Framework serialization to a user-defined configuration object; each config…
1
2 3 4 5