app-config

Using FileSystemMonitoring for reading changes in app.config and writing to app.config realtime

白昼怎懂夜的黑 提交于 2021-02-19 03:16:56
问题 I am using FileSystemWatcher to monitor any changes in the app.config file. And also, writing to the config file. Here is my code : MyApplication is the main project and DataCache is a clas library referenced in MyApplication. using System; using System.Threading; using System.IO; namespace MyApplication { public class Program { public static string rootFolderPath = Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location); public static string configFilePath = Path

Using FileSystemMonitoring for reading changes in app.config and writing to app.config realtime

萝らか妹 提交于 2021-02-19 03:15:06
问题 I am using FileSystemWatcher to monitor any changes in the app.config file. And also, writing to the config file. Here is my code : MyApplication is the main project and DataCache is a clas library referenced in MyApplication. using System; using System.Threading; using System.IO; namespace MyApplication { public class Program { public static string rootFolderPath = Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location); public static string configFilePath = Path

Assembly specific settings not loading at runtime

好久不见. 提交于 2021-02-19 02:43:05
问题 I am developing a .NET 3.5 Windows Forms app. I have two projects, the UI and a Library. UI uses strongly typed settings that are stored, as usually, in the app.config file. I read them using UI.Properties.Settings class (generated by Visual Studio). Library uses its own strongly typed Settings (the Settings.settings file that is dumped into Library.config file). At runtime, Library settings will not reload from the Library.config file. Only UI.config file is read by the runtime. So I am

WCF Named Pipe in Windows Service using App.Config

守給你的承諾、 提交于 2021-02-16 14:27:11
问题 I am frustrated. Okay, here is the error. There was no endpoint listening at net.pipe://localhost/MyIpcAppToService that could accept the message. This is often caused by an incorrect address or SOAP action. See InnerException, if present, for more details. I finally got the App.Config file working, at least no complaints. Current App.Config <?xml version="1.0" encoding="utf-8"?> <configuration> <!-- When deploying the service library project, the content of the config file must be added to

How to set app settings without save in c# [duplicate]

孤街浪徒 提交于 2021-02-08 12:13:31
问题 This question already has answers here : How to Update (Add/Modify/Delete) keys in AppSettings section of web.config at runtime (4 answers) Closed 3 years ago . We want to develop an application that gets the configuration items from a json file and stores the key&values at ConfigurationManager.AppSettings. But AppSettings dictionary is readonly. We don't want to update or save the app.config file. This operation have to be at memory. Is there any way to do this? 回答1: The answer was so easy.

How to create an application settings parameter of type a custom struct (or class)?

梦想的初衷 提交于 2021-02-08 07:43:47
问题 Having this struct: public struct MyStruct { public int MyInt { get; set; } public bool MyBool { get; set; } public string MyString { get; set; } public MyStruct(int myint, bool mybool, string mystring) { MyInt = myint; MyBool = mybool; MyString = mystring; } } How to store a value of this type in the application settings? The type is not available in the list of the new parameter to select its type and browing to enter the fully qualified type name does not work as it is not found. Most of

Mixed mode assembly is built against version 'v2.0.50727' of the runtime and cannot be loaded in the 4.0 runtime - Researched solutions not working

有些话、适合烂在心里 提交于 2021-02-07 09:24:25
问题 The following is my full error: Error in Microsoft.SqlServer.Dts.Runtime.TaskHost The Execute method on the task returned error code 0x80131621 (Mixed mode assembly is built against version 'v2.0.50727' of the runtime and cannot be loaded in the 4.0 runtime without additional configuration information. The Execute method must succeed, and indicate the result using an "out" parameter. I have found possible solutions here and here however I am still getting the above error. The following is my

Typesafe config: Load additional config from path external to packaged scala application

南楼画角 提交于 2021-02-05 12:59:08
问题 My scala application will be packaged into a jar. When I run my app, it needs to read an additional config file stored externally to my app jar. I am looking for functionality similar to the Typesafe Config library but other solutions are welcome too ! Is there a way to do something like below: val hdfsConfig = ConfigFactory.load("my_path/hdfs.conf") 回答1: I think what you want is: val myCfg = ConfigFactory.parseFile(new File("my_path/hdfs.conf")) 回答2: If your external configuration is to add

web.config and app.config machine-specific settings in git

女生的网名这么多〃 提交于 2021-02-05 12:55:30
问题 We have multiple teams of developers in different offices, and they need different values for a number of configuration setting in our projects' web.config and app.config files. We like to keep these configuration files checked in with a sensible set of default values, so that by checking out the trunk/master branch you have something working without needing to dig around for configuration files. Historically we've used Subversion, and specifically TortoiseSVN, and this provided an easy way

App Config Modification not reflected in code

断了今生、忘了曾经 提交于 2021-01-28 21:31:32
问题 I have a appsetting section in appconfig file as <appSettings> <add key="DayTime" value="08-20"/> <add key="NightTime" value="20-08"/> </appSettings> I am tyring to modify the app config while application is running. I changed key DayTime to 11-20 while application is running. Now if I run this code again to fetch data from config, it shows previous set values. private void btnDayNightSettings_ShowingEditor(object sender, ItemCancelEventArgs e) { string[] strDayTime = ConfigurationManager