Can I control the location of .NET user settings to avoid losing settings on application upgrade?

I wanted to add this quoted text as a reference for when i have this problem in the future. Supposedly you can instruct the ApplicationSettings infrastructure to copy settings from a previous version by calling Upgrade: Properties.Settings.Value.Upgrade(); From Client Settings FAQ blog post: (archive) Q: Why is there a version number in the user.config path? … Read more

When using a Settings.settings file in .NET, where is the config actually stored?

It depends on whether the setting you have chosen is at “User” scope or “Application” scope. User scope User scope settings are stored in C:\Documents and Settings\ username \Local Settings\Application Data\ ApplicationName You can read/write them at runtime. For Vista and Windows 7, folder is C:\Users\ username \AppData\Local\ ApplicationName or C:\Users\ username \AppData\Roaming\ ApplicationName Application … Read more

How to Unit test with different settings in Django?

EDIT: This answer applies if you want to change settings for a small number of specific tests. Since Django 1.4, there are ways to override settings during tests: https://docs.djangoproject.com/en/stable/topics/testing/tools/#overriding-settings TestCase will have a self.settings context manager, and there will also be an @override_settings decorator that can be applied to either a test method or a … Read more

Python: How would you save a simple settings/config file?

Configuration files in python There are several ways to do this depending on the file format required. ConfigParser [.ini format] I would use the standard configparser approach unless there were compelling reasons to use a different format. Write a file like so: # python 2.x # from ConfigParser import SafeConfigParser # config = SafeConfigParser() # … Read more

Equivalent to ‘app.config’ for a library (DLL)

You can have separate configuration file, but you’ll have to read it “manually”, the ConfigurationManager.AppSettings[“key”] will read only the config of the running assembly. Assuming you’re using Visual Studio as your IDE, you can right click the desired project → Add → New item → Application Configuration File This will add App.config to the project … Read more

How do you keep user.config settings across different assembly versions in .net?

ApplicationSettingsBase has a method called Upgrade which migrates all settings from the previous version. In order to run the merge whenever you publish a new version of your application you can define a boolean flag in your settings file that defaults to true. Name it UpgradeRequired or something similar. Then, at application start you check … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)