Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

When using ConfigurationSections in app.config - do you get intellisense?

Tags:

c#

app-config

Consider:

http://msdn.microsoft.com/en-us/library/2tw134k3.aspx

When you are creating your custom types in the app.config do you get intellisense to aid you?

Or is it a case of programming in XML 'on your own'? It does not appear to be working for me, if this is the case that's fine but if intellisense is meant to work I know I'm doing something wrong.

Thanks

like image 788
Finglas Avatar asked Feb 03 '26 04:02

Finglas


2 Answers

No, not by default.

If you want intellisense, it is possible. Then you should write an XML schema for your configuration section, and reference it in the config file (put xmlns=yournamespace on the the configuration element and make sure Visual Studio knows where to find the schema).

like image 126
driis Avatar answered Feb 04 '26 18:02

driis


Same for me. I don't usually find this to be problematic though, since the configuration sections typically are not very complicated.

I often put in a commented template element for custom sections, explaning the syntax, which may help in editing the config file when you revisit it after a couple of months and have a somewhat vaguer idea of the structure than when it was first implemented...

like image 40
Fredrik Mörk Avatar answered Feb 04 '26 18:02

Fredrik Mörk



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!