【问题标题】:Visual Studio 2012 app.config is not updated when settings tab changes设置选项卡更改时未更新 Visual Studio 2012 app.config
【发布时间】:2013-05-31 15:21:36
【问题描述】:

当我从项目属性设置选项卡更改它们时,似乎无法让 app.config 获取新设置值。

我尝试清理项目并重新编译,但没有帮助。

[app.exe].config 文件是在编译输出路径中生成的,但 app.config 的值不是我在 VS2012 中项目属性的设置选项卡中的每个编译中放入的值...

有什么想法吗?

【问题讨论】:

    标签: visual-studio app-config configuration-files


    【解决方案1】:

    您可以使用应用程序设置...它适用于 VS 2005

    例如:

    创建新设置:项目菜单->属性->设置->创建如下设置

    Name         Type               Scope      Value
    myLoc   System.Drawing.Point    User       2;2
    

    应用于应用

    Form_Load 时读取设置

    Button1.Location = My.Settings.myLoc
    

    更改并保存设置

    My.Settings.myLoc = Button1.Location
    My.Settings.Save()
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2018-07-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多