Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Config.web custom sections
Message
Information générale
Forum:
ASP.NET
Catégorie:
Autre
Titre:
Config.web custom sections
Divers
Thread ID:
00694210
Message ID:
00694210
Vues:
35
I'm trying to create a custom section in the config.web file that I can access from various classes running in my ASP.NET app. I've been through this about 50 times already, checked dozens of websites, docs, etc. and from what I've seen, my code should work. My web.config file looks like:
  <configSections>
	  <sectionGroup name="CustomSettings"> 
	     <section name="WebSecurity" type="System.Configuration.NameValueSectionHandler, System" />
	  </sectionGroup>
   </configSections>
   
  <CustomSettings>
		<WebSecurity>
			<add key="caseSensitive" value="false" />
			<add key="explicitAllow" value="false" />
			<add key="noAccessLink" value="denied.htm" />
		</WebSecurity>   
  </CustomSettings>  
When I try accessing it from one of my classes, using this code:
NameValueCollection config = (NameValueCollection) ConfigurationSettings.GetConfig("CustomSettings/WebSecurity");	
It blows up with a "File or assembly name System, or one of its dependencies, was not found. (C:\www\Default\WebApplication1\web.config line 5)"

I've tried specifying the full System assembly info:
 <section name="WebSecurity" type="System.Configuration.NameValueSectionHandler, System, Version=1.0.3300.0, Culture=neutral, 
         PublicKeyToken=b77a5c561934e089" />
and I've even looked in the Manifest for System.DLL to make sure the version and Public Key Token are correct. Nothing has helped. Does anyone have any ideas on what might be wrong with this?

Thanks,
-Paul

RCS Solutions, Inc.
Blog
Twitter
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform