2

我在 c++ 程序中嵌入了单声道并加载了一个需要 app.config 的 dll。我收到这种错误,有人知道如何使用嵌入式单声道发送* .config 吗?

堆栈跟踪:

System.Configuration.ConfigurationErrorsException: Error Initializing the configuration system. ---> System.ArgumentException: The 'ExeConfigFilename' argument cannot be null.
  at System.Configuration.ExeConfigurationHost.CheckFileMap (ConfigurationUserLevel level, System.Configuration.ExeConfigurationFileMap map) [0x00000] in <filename unknown>:0 
  at System.Configuration.ExeConfigurationHost.InitForConfiguration (System.String& locationSubPath, System.String& configPath, System.String& locationConfigPath, IInternalConfigRoot root, System.Object[] hostInitConfigurationParams) [0x00000] in <filename unknown>:0 
  at System.C[] hostInitConfigurationParams) [0x00000] in <filename unknown>:0 
  at System.Configuration.ConfigurationManager.OpenExeConfigurationInternal (ConfigurationUserLevel userLevel, System.Reflection.Assembly calling_assembly, System.String exePath) [0x00000] in <filename unknown>:0 
  at System.Configuration.ClientConfigurationSystem.get_Configuration () [0x00000] in <filename unknown>:0 onfiguration.InternalConfigurationSystem.InitForConfiguration (System.String& locationConfigPath, System.String& parentConfigPath, System.String& parentLocationConfigPath) [0x00000] in <filename unknown>:0 
  at System.Configuration.Configuration..ctor (System.Configuration.InternalConfigurationSystem system, System.String locationSubPath) [0x00000] in <filename unknown>:0 
  at System.Configuration.InternalConfigurationFactory.Create (System.Type typeConfigHost, System.Object
4

1 回答 1

1

自我回答:你不能(截至 2013 年 4 月 30 日)。要启用此行为,我必须更改单声道的框架源 mono/mcs/class/corlib/system/appdomain.cs :

public AppDomainSetup SetupInformation {
    get {
        return SetupInformationNoCopy; // newline
        //  AppDomainSetup setup = getSetup (); //old
        //  return new AppDomainSetup (setup); //old
    }
}
于 2013-04-30T23:42:22.843 回答