把这个文件Copy到实际运行的目录下不就行了么。

解决方案 »

  1.   

    以下代码是IDE自动生成的。我的程序在IDE中启动可以工作。如果从Windows 资源管理器中运行就会出错。说什么“System.Configuration.ConfigurationSettings”并不包含对“appSettings”的定义” 
    System.Configuration.AppSettingsReader configurationAppSettings = new System.Configuration.AppSettingsReader();
    this.button1 = new System.Windows.Forms.Button();
    this.SuspendLayout();
    // 
    // button1
    // 
    this.button1.Enabled = ((bool)(configurationAppSettings.GetValue("button1.Enabled", typeof(bool))));
     ---调试发现出错是在句。也就是GetValue出错。

    我的app.config文件如下(也是IDE自动生成的):
    <?xml version="1.0" encoding="utf-8"?>
    <configuration>
    <appSettings>
    <!--   此处显示用户应用程序和配置的属性设置。-->
    <!--   示例:<add key="settingName" value="settingValue"/> -->
    <add key="button1.Enabled" value="True" />
    </appSettings>
    </configuration>