application-settings

Access section 'applicationSettings' (not 'appSettings') in config file from setup

徘徊边缘 提交于 2019-12-22 18:44:09
问题 I am in the process of creating a setup for a web application we build. No I have a configuration file, which looks something like like this, which contains a section 'appSettings', and a section 'applicationSettings': <configuration> <appSettings> <add key="Password" value="dummy"/> <add key="Username" value="dummy"/> <add key="DB" value="dummy"/> <add key="DBServer" value="dummy"/> <add key="LogStoredProcedure" value="dummy"/> <add key="ErrorStoredProcedure" value="dummy"/> <add key=

App.Config vs Custom XML file

淺唱寂寞╮ 提交于 2019-12-22 05:29:07
问题 I have read a lot of statements like " you shouldn't clog your app.config file with custom settings ". However, I was under the impression that this was exactly the purpose of the file? Is it just indeed a preference thing? Or are there any real benefits (other than separation of settings) by using a custom XML file, as apposed to the app.config file? If you need to explicitly separate settings would it better to use a custom ConfigurationSection rather than opting for a custom XML file? I

.NET ApplicationSettingsBase Should I call Upgrade() every time I load?

我们两清 提交于 2019-12-22 04:17:06
问题 We have application settings derived from ApplicationSettingsBase . When we push a new version of our app we need to call: // // Summary: // Updates application settings to reflect a more recent installation of the // application. public virtual void Upgrade(); (from the meta-data) Now there are some tricky ways to determine if your settings need to be upgraded such as this post which would seem to me to only ever upgrade your settings once. Now I could store the current version of my

Define a custom path where the user.config file should be saved?

。_饼干妹妹 提交于 2019-12-22 03:50:36
问题 If I rename my compiled application for example from myapp.exe to app.exe then when I run the renamed executable a new user settings folder is generated in this path: C:\Users\{User}\AppData\Local\{CompanyName}\{ExecutableName}_Url_{SystemGUID or something strange} So I loose all the saved settings. Then how I could solve this problem defining in a VBNET WinForms my own location to store the user.config file, or any other solution using the applicationsettings infrastructure ? (not saving the

How to remove Settings when uninstalling

被刻印的时光 ゝ 提交于 2019-12-21 12:27:26
问题 My program is installed with a Visual Studio Setup project. The program, when run, creates a user.config file in its default location since I'm using Settings. When uninsalling, how do I get the uninstaller to remove that user.config file? Also, how do I cause the uninstaller to remove a folder in %AppData% ? 回答1: You will need to write a custom task for that - by default (and design) the installer will only remove what it installed, anything that added afterwards is not part of the install

Convention based binding of constructor string arguments with Ninject

谁都会走 提交于 2019-12-21 09:25:04
问题 I'm using Ninject as IoC container in my project. I have following class: public class SomeRepository:ISomeRepository { public SomeRepository(string someDatabaseConnectionString) { // some code here.. } } In my application settings file I have connection string named "someDatabase". By default the one should add following configuration in order to inject this connection string into the constructor: kernel.Bind<ISomeRepository>() .To<SomeRepository>() .WithConstructorArgument(

Visual Studio, Application Settings… rearrange

天涯浪子 提交于 2019-12-20 11:53:06
问题 Silly questions... purely aesthetic... given the picture above. How do you move the values up/down? For example, State belongs grouped with Height/Width/Top/Left (Window Position + state). Not the only project where I later add stuff and it slowly gets out of order. Can delete/re-add, but that gets tedious and error prone. Can just leave it as is, but it's a minor annoyance. Am I totally not seeting the setting somewhere to move the stuff around, because I've looked and I just don't see it.

Why do people consistently recommend using appConfig instead of using Settings files? (.NET)

你离开我真会死。 提交于 2019-12-20 08:11:19
问题 Very often I see the answer to the question like: "How should I store settings in my .NET app?" is to edit the app.config file by manually adding entries to the app.config (or web.config) like so: <configuration> <appSettings> **<add key="ConfigValueName" value="ABC"/>** </appSettings> </configuration> Then, accessing them like: string configValue = Configuration.AppSettings["ConfigValueName"]; I'll refer to the approach outlined above as the "app.config" approach. Very rarely do I see people

Xamarin Forms Sharedpreferences cross

瘦欲@ 提交于 2019-12-19 05:17:41
问题 I'd like to know what is the best solution to manipulate application settings in a cross-platform way. In iOS we can change the settings outside the app in the settings screen, but we don't have that in windows phone and android. So, my idea is to create a normal page/screen inside the app that shows all my application settings and have an interface with Save() and Get() methods that I can implement specific per device using DependencyServices. Is this the right way to do it? 回答1: The

Keep settings in sync between forms application and windows service (or any n-tier, really)

ぐ巨炮叔叔 提交于 2019-12-18 17:05:16
问题 I have a Windows Service that performs a number of periodic activities, and I want to change the settings of this service from a Windows Forms app. I'm not sure, though, about the best way to make sure the service has the most updated user preferences in it (how often to run, what folders to use for things, whatever else the user can specify). The user can change settings any time, at will, and I'd like the service know about it almost immediately. Here are the options I'm weighing: The form