application-settings

WinForms Application Settings changes don't appear to be persisting

♀尐吖头ヾ 提交于 2020-05-17 06:34:32
问题 In my C# WinForm I have a settings window that allows the user to change database connection settings. At design time I set the initial settings that would connect to a database successfully. I'm accessing those settings in either of two ways: Either in the Solution Explorer: Or in the Project's Application Settings: However, I noticed that if I change any of the values in the Settings.Settings file, the form still loads with the values that I initially set each to. To be clear: one of the

Can a spring boot @RestController be enabled/disabled using properties?

可紊 提交于 2020-04-25 01:44:15
问题 Given a "standard" spring boot application with a @RestController , eg @RestController @RequestMapping(value = "foo", produces = "application/json;charset=UTF-8") public class MyController { @RequestMapping(value = "bar") public ResponseEntity<String> bar( return new ResponseEntity<>("Hello world", HttpStatus.OK); } } Is there an annotation or technique that prevents the endpoint from starting at all if/unless a certain application property exists/doesn't exist. Note: Testing a property

Can a spring boot @RestController be enabled/disabled using properties?

浪子不回头ぞ 提交于 2020-04-25 01:40:54
问题 Given a "standard" spring boot application with a @RestController , eg @RestController @RequestMapping(value = "foo", produces = "application/json;charset=UTF-8") public class MyController { @RequestMapping(value = "bar") public ResponseEntity<String> bar( return new ResponseEntity<>("Hello world", HttpStatus.OK); } } Is there an annotation or technique that prevents the endpoint from starting at all if/unless a certain application property exists/doesn't exist. Note: Testing a property

C# - Compiler Error: System.Configuration.ConfigurationErrorsException was unhandled

◇◆丶佛笑我妖孽 提交于 2020-01-16 03:28:41
问题 Hey Everyone, How do I fix the Compiler Error upon compiling on " return ((string)(this["TargetDir"])); ": System.Configuration.ConfigurationErrorsException was unhandled Configuration system failed to initialize {"Unrecognized configuration section userSettings/CCP.Settings1. (C:\\Users\\bmccarthy\\Documents\\Visual Studio 2008\\Projects\\CCP Utility\\CCP Utility\\bin\\Debug\\CCP_Utility.exe.config line 21)"} A first chance exception of type 'System.Configuration.ConfigurationErrorsException

ApplicationSettings in .NET from Unmanaged Application

本小妞迷上赌 提交于 2020-01-07 05:36:06
问题 We have a VB6 application which launches .NET WinForms code. We'd like to use a .settings file in the .NET assembly for storing user-specific application settings. MS says: You cannot use application settings in an unmanaged application that hosts the .NET Framework. Settings will not work in such environments as Visual Studio add-ins, C++ for Microsoft Office, control hosting in Internet Explorer, or Microsoft Outlook add-ins and projects. How can we get this working so we can use a

How to get application settings path in winforms?

一个人想着一个人 提交于 2020-01-06 05:36:14
问题 In Settings.Settings in Winforms I have some User settings, and I must clean up them. I can't do it by: Settings.Default.SomeUserSettings = null; It must be done by hand . So, where can I find those settings ? I'm using windows 7. Or maybe you know some application, from which I can find last edited files? 回答1: Look in the folder of your application, there is a XML file named yourAppName.exe.config . This is where the user settings are saved. To get the path you can use : string path =

StringCollection in application settings doesn't get stored

家住魔仙堡 提交于 2020-01-02 07:09:11
问题 I would like to use a StringCollection as application settings, however while reading it's not a problem, I found out that settings are not stored. How to make it works? Any workaround? What's the problem here? Code I'm using: private static void AddToRecentProfiles(string path) { if (SpellCaster3.Properties.Settings.Default.RecentProfiles == null) SpellCaster3.Properties.Settings.Default.RecentProfiles = new StringCollection(); int index = SpellCaster3.Properties.Settings.Default

How to get the Name of an application setting in C#?

南笙酒味 提交于 2020-01-02 07:03:11
问题 In application setting of visual c#, we can create a series of settings with specific Name, Type, Scope and Value. I have access to the value by the code: string color= Myproject.Properties.Settings.Default.mycolor; How can I get "mycolor", which is the name of this setting, in the output? 回答1: If you want the name of the setting, then you are looking to get the property name. In the book Metaprogramming in .NET, Kevin Hazzard has a routine that looks something like this: /// <summary> ///

Azure does not override application settings

萝らか妹 提交于 2020-01-02 05:32:27
问题 In my Azure App Service I want to update application settings, but after publish from VS the keys doesn't override values from local Web.config In Azure it looks like: In the result my web.config on azure contains values from local settings <connectionStrings> <add name="MainConnectionString" connectionString="ConnectionStringToReplaceByAzure" providerName="System.Data.SqlClient" /> </connectionStrings> <appSettings> <add key="MS_SigningKey" value="Overridden by portal settings" /> <

Reading default application settings in C#

妖精的绣舞 提交于 2019-12-31 08:20:09
问题 I have a number of application settings (in user scope) for my custom grid control. Most of them are color settings. I have a form where the user can customize these colors and I want to add a button for reverting to default color settings. How can I read the default settings? For example: I have a user setting named CellBackgroundColor in Properties.Settings . At design time I set the value of CellBackgroundColor to Color.White using the IDE. User sets CellBackgroundColor to Color.Black in