[IronPython] custom ConfigurationSection in IronPython

Jason Ferrara jason.ferrara at jacquette.com
Wed Aug 30 20:33:05 CEST 2006


I want to write a custon ConfigurationSection in IronPython. So I try...

class MySettings(System.Configuration.ConfigurationSection):
	# custom configuration stuff here

c = System.Configuration.ConfigurationManager.OpenExeConfiguration( \
         System.Configuration.ConfigurationUserLevel.PerUserRoaming)
c.Sections.Add("mysettings",MySettings()) 

and get...

   File , line 0, in Add##32
   File System.Configuration, line unknown, in Add
   File System.Configuration, line unknown, in AddConfigurationSection
   File System.Configuration, line unknown, in  
GetConstructorWithReflectionPermis
sion
SystemError: Unable to load type  
'IronPython.NewTypes.System.Configuration.ConfigurationSection_2,  
snippets1, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null'  
because it is not public. 

This happened even when the python code is compiled into an assembly.

Is there a way to make this work?

I saw a post that mentioned an experimental static type compiler.  
Would I need to use that, and if so how?

Thanks.

- Jason


More information about the Ironpython-users mailing list