[Ironpython-users] Assembly references: file does not exist?

Jimmy Schementi jschementi at gmail.com
Thu Jul 14 16:28:28 CEST 2011


On Jul 14, 2011, at 7:59 AM, Dave Peterson wrote:
> Turns out that I can put an ipy.exe.config in the install location of IronPython and get my assembly to load.  
> 
> Does anyone know if there's an equivalent programmatic way to do this?  For example, can I import the clr module, call some .NET methods, and then try my assembly loading?  I'm a .NET noob and I don't see any App or App.Config API when I browse MSDN.   Am I just missing it?


The App.config API is System.Configuration: http://msdn.microsoft.com/en-us/library/gg145027.aspx. But that won't get you anywhere by itself; the <startup useLegacyV2RuntimeActivationPolicy="true"> setting is used when the CLR creates the main AppDomain. To programmatically change this, you'd need to start your own AppDomain with the desired config. There is already an open feature request to support this: http://ironpython.codeplex.com/workitem/26165.

As a work-around, make a copy of ipy.exe source (very tiny), adding your custom configuration file, and build it ... using that version of ipy.exe to run your IronPython code that depends on the custom config.

~Jimmy
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/ironpython-users/attachments/20110714/cbc1d1c4/attachment.html>


More information about the Ironpython-users mailing list