Menu
  • HOME
  • TAGS

App.config deprecated C#?

c#,app-config,application-settings

ApplicationSettings are preferred over AppSettings as they are strongly typed, but there are times (such as in Azure) where AppSettings are preferred as they can be set from the Azure control panel on an instance by instance basis. That said, let's look at the other part of your question relating...

It's possible change a settings.settings file without recompiling in .NET?

.net,dll,configuration,configuration-files,application-settings

No, is not posible, the best approach to make this is setting your configuration inside a Database so you won't recompile if you need change the file, or you can create your own read file method.

Visual Basic 2010 Overflow Error

vb.net,application-settings,integer-overflow

2 billion is the maximum value for the Integer data type, you can use Long instead to allow you to go up to about 9 * 10^18. If you want to use numbers that can be of any size at all, you should look at System.Numerics.BigInteger. You will need to...

Are Application Settings reliable?

c#,winforms,visual-studio,application-settings

Yes, they are reliable. And they will do it very well because they will take under consideration OS-specific conventions and OS user profiles. So, I'd say it's a recommended practice. There is a small catch: A later version of your application may look for settings for its own version, even...

Optimizing Save and Load of Settings in VB.Net Application

vb.net,optimization,save,load,application-settings

I fixed the problem by simply disabling the TabControl once the loading of the setting began. For some reason it sped up the process by a good amount :) TabControl1.Enabled = False LoadSettings() Label3.Text = "Settings loaded!" TabControl1.Enabled = True ...

C++11 class for managing application settings

class,templates,c++11,application-settings

I'd prefer option #1, precisely because it doesn't need to know of all setting types in advance. However, you should add some error checking into get() to react to a situation when the appropriate setting is not found (and thus it == settings_.end()).

Inner workings of .NET – can be built-in settings loader reached by code?

.net,startup,application-settings,my.settings

I have recently found, that default way how settings are handled does not allow nor even support my scenario. Evaluation of ConfigurationManager.OpenExeConfiguration( ConfigurationUserLevel.PerUserRoamingAndLocal).FilePath gives different local settings directory when invoked from original application and when invoked from loaded assembly. Compare outputs of the same method: When called directly: C:\Users\Miroxlav\AppData\Local\WindowsApplication1\WindowsApplicationSetting_Url_za1afclumj0mqqjsghdpysdumjr5jd21\1.0.0.0\user.config When...

Is storing variables in $rootScope good practice?

angularjs,application-settings

Try not to pollute the $rootScope as much as possible. Make a Settings service that handles the settings instead. Services are singleton objects so once you initialize the service, the settings will be available everywhere you inject the service. MyApp.service("Settings", function($http) { var settings = null; this.initialize = function() {...

What is the best way to store settings in C# PCL [closed]

c#,storage,portable-class-library,application-settings

using System.Xml.Serialization; using PCLStorage; using System.IO; public virtual async Task<T> LoadSettings<T>(IFile file = null) where T : IApplicationSettings { // File if (file == null) file = DefaultSettingsFile; // Open file using (Stream fileStream = await file.OpenAsync(FileAccess.Read)) { var xmls = new XmlSerializer(typeof(T)); return (T)xmls.Deserialize(fileStream); } } public virtual...

Are WPF Application Settings automatically saved by default?

wpf,vb.net,visual-studio-2012,application-settings

Are settings saved automatically? No, you have to explicit invoke the Save method upon each settings class. Since you mention that you have multiple windows, then i think the quick and dirty way would be to override the OnExit Method in App: Class Application Protected Overrides Sub OnExit(ByVal e As...

ConfigurationManager.AppSettings Returns Null In Unit Test Project

c#,visual-studio,unit-testing,app-config,application-settings

You mentioned settings in the project properties. See if you can access the setting this way: string test = Properties.Settings.Default.Bing_Key; You may need to get the executing assembly of where the project settings file is defined, but try this first. EDIT When using Visual Studio's project settings file, it adds...

:Set project application settings to defaults

c#,visual-studio,default,application-settings

You can specify defaults for user settings from Visual Studio, in the Properties window of the project, in the Settings tab. Just enter something in the Value column. The values you specify get saved in app.config, in the userSettings section (you can edit them there, too), and they will be...

Reading settings from applicationSettings is very slow?

c#,performance,settings,application-settings

There is less overhead if you use: <appSettings> Rather than: <applicationSettings> However, you lose some benefits (e.g. type checking), so it's a give-and-take....

How can I add the application settings to my installer in a WPF project?

c#,wpf,application-settings,settings.settings

Application Scope Settings are persisted in the applications config file. It is located in the applications output directory and called [ApplicationName].exe.config. This is probably the one you want. User scope settings are persisted in the file User.config in the users settings folder: C:\Documents and Settings\[UserName]\Local Settings\Application Data\[ApplicationName] Vista and Windows...

More than one instance of IsolatedStorageSettings?

c#,windows-phone-8,isolatedstorage,application-settings,isolatedstoragefile

Check out this article on MSDN IsolatedStorageSettings.ApplicationSettings Property as it clearly state Gets an instance of IsolatedStorageSettings that contains the contents of the application's IsolatedStorageFile, scoped at the application level, or creates a new instance of IsolatedStorageSettings if one does not exist. so it is not possible to create more...

Application settings values are default when read from another project

c#,application-settings

The correct term for "project" is actually assembly so I will use that when referring to "project". The ConfigurationManager does not work the way you are trying to use it. The files are not hardcoded/locked to the particular assemblybut rather to the specific executable.config and user.config. When retrieving settings from...

How to include .config file or a dependency project in to bin folder of a main project?

c#,build,localization,application-settings

Right click on the Business.config file in Solution Explorer. Select Properties and set Property Copy to Output Directory to Copy if Newer or Copy always. This will copy configuration along with your business project dll (where ever you reference it in other C# project). See image below: ...

SublimeText: When the lines are longer than the width of the screen

sublimetext2,settings,sublimetext,application-settings

Use "word_wrap": false in your User Preferences

Visual Studio Application Settings returning a null pointer

c#,visual-studio,null,application-settings

So... the way it works is this: The settings are saved in "app.config" file in the project directory. When this file gets corrupted it is useless to reset the settings or reload. The only way to fix this is by deleting the file. This way, a new file will be...

AlertDialog If/Else to check against system services?

java,android,gps,alertdialog,application-settings

You can use this to check if WiFi is enabled: public boolean isWiFiEnabled(Context context) { WifiManager wifi = (WifiManager) context.getSystemService(Context.WIFI_SERVICE); return wifi.isWifiEnabled(); } To check if GPS is enabled you can use: public boolean isGPSEnabled (Context context){ LocationManager locationManager = (LocationManager) context.getSystemService(Context.LOCATION_SERVICE); return locationManager.isProviderEnabled(LocationManager.GPS_PROVIDER); } EDIT: I'd use it this...