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

前端 未结 17 1733
醉话见心
醉话见心 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:14

    Taking a dependency on the registry prevents XCOPY Deployment.

    0 讨论(0)
  • 2020-12-13 15:15
    • The registry is huge so it can be cumbersome to locate the relevant information (even with searching).
    • It is possible to affect other applications by accident when modifying the registry.
    • If the registry is corrupted all applications may be affected (including the OS).
    • You need special purpose tools to search, modify and even copy the registry.

    I prefer config files.

    0 讨论(0)
  • 2020-12-13 15:18

    One immediate (but important) advantage:

    With plain configuration files, users can restore their settings easily in case of a reinstall / restore from backup. It's a lot harder to do this from registry values.

    0 讨论(0)
  • 2020-12-13 15:19

    I think there is a huge security issue about Application Setting (.config files) is that can be edited in any text editor and change every thing.

    Let's say that a connectionString is stored and some one deleted or changed all values in the config file then the application will have a lot of proplem so the config file should be protected.

    or store Setting in DLL file for example.

    0 讨论(0)
  • 2020-12-13 15:21

    One big advantage of moving to config files over the registry is to allow side-by-side installs of the same program. With the registry, central configuration info would overlap for these duplicate installs, but using config files, the information is kept private to each specific install. It's true that user-specific configuration overrides might potentially overlap (since they're stored in the user's app data folder, not specific to the install path), but imagine a scenario where different users use different installs, in which case this potential problem becomes irrelevant.

    0 讨论(0)
提交回复
热议问题