C# 在运行时设置ConfigurationFile

C# 在运行时设置ConfigurationFile,c#,python,mono,python.net,C#,Python,Mono,Python.net,我在项目中使用python.Net来包含一个依赖于app.config的c#dll。 我的python项目显然没有定义app.config,因此在添加对dll的引用之前,我将配置文件设置为如下所示 System.AppDomain.CurrentDomain.SetData("APP_CONFIG_FILE", "myfile.config") 当构建在Windows上时,此功能可以正常工作。但是在使用Mono的Linux上,当dll试图通过 System.AppDomain.CurrentD

我在项目中使用python.Net来包含一个依赖于app.config的c#dll。 我的python项目显然没有定义app.config,因此在添加对dll的引用之前,我将配置文件设置为如下所示

System.AppDomain.CurrentDomain.SetData("APP_CONFIG_FILE", "myfile.config")
当构建在Windows上时,此功能可以正常工作。但是在使用Mono的Linux上,当dll试图通过

System.AppDomain.CurrentDomain.SetupInformation.ConfigurationFile
ConfigurationFile将为空

在我的谷歌搜索中,我找到的唯一参考是这张未解决的罚单

我还尝试将APP_CONFIG_文件的设置移动到我的dll中,但没有成功