<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div><div>On Jul 14, 2011, at 7:59 AM, Dave Peterson wrote:</div><blockquote type="cite"><div>Turns out that I can put an ipy.exe.config in the install location of IronPython and get my assembly to load. &nbsp;<br><br>Does anyone know if there's an equivalent programmatic way to do this? &nbsp;For example, can I import the clr module, call some .NET methods, and then try my assembly loading? &nbsp;I'm a .NET noob and I don't see any App or App.Config API when I browse MSDN. &nbsp;&nbsp;Am I just missing it?</div></blockquote></div><div><br></div><div>The App.config API is System.Configuration:&nbsp;<a href="http://msdn.microsoft.com/en-us/library/gg145027.aspx">http://msdn.microsoft.com/en-us/library/gg145027.aspx</a>. But that won't get you anywhere by itself; the &lt;startup&nbsp;useLegacyV2RuntimeActivationPolicy="true"&gt; setting is&nbsp;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:&nbsp;<a href="http://ironpython.codeplex.com/workitem/26165">http://ironpython.codeplex.com/workitem/26165</a>.</div><div><br></div><div>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.</div><div><br></div><div>~Jimmy</div></body></html>