How to save user.config to AppData\Roaming folder instead of AppData\Local?

前端 未结 2 2069
时光取名叫无心
时光取名叫无心 2020-12-23 22:09

Introductory Example

This code

Properties.Settings.Default.MyUserSettingBlah = \"some new value\";
Properties.Settings.Default.Save(         


        
2条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2020-12-23 23:12

    I stumbled on this now...

    As far as I know, it should be that you should put:

    [global::System.Configuration.SettingsManageability(System.Configuration.SettingsManageability.Roaming)]        
    

    in Settings.Designer.cs for each settng that should go to roaming profile.

    Alternatively you can change this on the Settings screen in Visual Studio 2010 by selecting the setting(s) and displaying it's properties (F4). There you can set the Roaming property to True.

提交回复
热议问题