How to use IronPython with App.Config?

前端 未结 6 1828
醉梦人生
醉梦人生 2021-02-05 07:13

I have a class library that is usually called from a .net console or web application. It integrates with various components, and relies on an app.config or web.config.

I

6条回答
  •  太阳男子
    2021-02-05 07:42

    Translating this blog post into Python, this should work:

    import clr
    import System.AppDomain
    System.AppDomain.CurrentDomain.SetData(“APP_CONFIG_FILE”, r”c:\your\app.config”)
    

提交回复
热议问题