The default method for instantiating a configuration section does not seem to work design-time:
returns a null-reference when accessed design-time.
I've found some resources on this subject, but they only seem to work for classes that inherit
, and therefore any initialization would not be static nor its behaviour singleton anymore. The 'correct' way to do this would be:
public CustomResourceProvider Instance()
IWebApplication webApp = (IWebApplication)base.Component.Site.GetService(typeof(IWebApplication));
if (webApp == null) return null;
System.Configuration.Configuration config = webApp.OpenWebConfiguration(true);
Where "MySectionName" would refer to the constant as defined by CSD.
Any ideas on this?