Why aren't .NET “application settings” stored in the registry?

前端 未结 17 1802
醉话见心
醉话见心 2020-12-13 14:51

Some time back in the nineties, Microsoft introduced the Windows Registry. Applications could store settings in different hives. There were hives for application-wide and us

17条回答
  •  悲&欢浪女
    2020-12-13 15:02

    I think that one of the main reasons for this was application updates. When you install an update (i.e. using ClickOnce), the new settings actually go into a new folder. When you uninstall it, the new folder is deleted and the old settings are still around. If the registry were used instead, there would be no way to do this "versioning."

    Other reasons might include:

    • Permissions (app settings always go into AppData/LocalAppData which requires no privileges)
    • Ease of maintenance/backups
    • Portability (it's rather difficult to deal with the registry using the .NET Compact Framework, and god help you if you're trying to support Mono).

提交回复
热议问题