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

Setting DEBUG = False causes 500 Error

Django 1.5 introduced the allowed hosts setting that is required for security reasons. A settings file created with Django 1.5 has this new section which you need to add: # Hosts/domain names that are valid for this site; required if DEBUG is False # See https://docs.djangoproject.com/en/1.9/ref/settings/#allowed-hosts ALLOWED_HOSTS = [] Add your host here like [‘www.beta800.net’] … Read more

Where are the Properties.Settings.Default stored?

In order to work with newer versions of Windows’ policy of only allowing read access by default to the Program Files folder (unless you prompt for elevation with UAC, but that’s another topic…), your application will have a settings folder under %userprofile%\appdata\local or %userprofile%\Local Settings\Application Data depending on which version of Windows you’re running, for … Read more

How to configure a static IP address, netmask, gateway programmatically on Android 3.x or 4.x

I realise that there is no API on 3.x or 4.x for those setting per SSID. Therefore, I checked out the source code and found out that the configuration of each SSID is stored in android.net.wifi.WifiConfiguration which is gotten from android.net.wifi.WifiManager. In the below code, IpAssignment is an Enum, either STAIC, DHCP or NONE. And … Read more

How do I open phone settings when a button is clicked?

Using UIApplication.openSettingsURLString Update for Swift 5.1 override func viewDidAppear(_ animated: Bool) { let alertController = UIAlertController (title: “Title”, message: “Go to Settings?”, preferredStyle: .alert) let settingsAction = UIAlertAction(title: “Settings”, style: .default) { (_) -> Void in guard let settingsUrl = URL(string: UIApplication.openSettingsURLString) else { return } if UIApplication.shared.canOpenURL(settingsUrl) { UIApplication.shared.open(settingsUrl, completionHandler: { (success) in print(“Settings … Read more

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

Instant run in Android Studio 2.0 (how to turn off)

UPDATE In Android Studio Version 3.5 and Above Now Instant Run is removed, It has “Apply Changes“. See official blog for more about the change. we removed Instant Run and re-architectured and implemented from the ground-up a more practical approach in Android Studio 3.5 called Apply Changes.Apply Changes uses platform-specific APIs from Android Oreo and … Read more