app-config

My web.config references an assembly used by a dependent DLL library. Any way around this?

不打扰是莪最后的温柔 提交于 2019-12-08 01:22:43
问题 Here is my concrete example. I have written a dll which uses EntityFramework to talk to a database and do some work. Originally, the front end was a console application, but there is now an additional requirement for a web front end as well. From what I've read, the 'top-most' application (web app or console app) should store all the configuration, even the configuration which is needed only by the dll itself. (I will use the web app as my example from now one, but it applies to the console

Problems while reading value from app.config file

。_饼干妹妹 提交于 2019-12-08 00:15:03
问题 I am making one windows application in c# in where i added one file as app.config file.I have written some code in that file as <appSettings> <add key ="FlagForArchiving" value="true"/> </appSettings> In 'program.cs' file i am reading this value as ConfigurationSettings.AppSettings["FlagForArchiving"].ToString(); On local machine i can retrieve value from config file but whenever i am building that application and running on any other machine then I cant read the value from config file.I am

Storing data into appconfig from textbox

ε祈祈猫儿з 提交于 2019-12-07 23:33:27
问题 I have textbox in which I select path for .txt , in it are saved and encoded data for SqlConnection : Stream myStream = null; OpenFileDialog openFileDialog1 = new OpenFileDialog(); openFileDialog1.InitialDirectory = "c:\\"; openFileDialog1.Filter = "txt files (*.txt)|*.txt|All files (*.*)|*.*"; openFileDialog1.FilterIndex = 2; openFileDialog1.RestoreDirectory = true; if (openFileDialog1.ShowDialog() == DialogResult.OK) { try { if ((myStream = openFileDialog1.OpenFile()) != null) { using

Where to put application data and temp files on Windows, Linux and MAC if java-application is being lauched using JWS

十年热恋 提交于 2019-12-07 19:51:40
问题 Can we allow user to set and save application data and temp data using Java-Application that has beenrun/launch using JWS ? Does it make sense ? We would like to know if user run JNLP directly then can user save preferences settings on local so when he/she run again JNLP he/she could find his/her last saved settings again. Where to put application data i.e configuration files, properties file. user download path etc.. and where to put temp files i.e.. logs etc.. on Windows, Linux and MAC if

appname.exe.config not created on windows application

拜拜、爱过 提交于 2019-12-07 18:14:20
问题 When I build a windows application. It does not work because it cannot read my app.config file. I looked in the bin directory and it does not have the appname.exe.config file. If I manually copy over the app.config and rename it the appname.exe.config the application will work..but when I build the project this file is never created automagically. What am I missing? Why is my project not creating it? I have looked through the whole folder structure and there is no other config files. 回答1:

Code required to use foreach on my own custom appSettings

心不动则不痛 提交于 2019-12-07 18:04:38
问题 I've searched the site and haven't found exactly what I'm looking for. Close, but no cigar. Basically I want to have a config section like this: <configSections> <section name="PhoneNotificationsSection" type="Alerts.PhoneAlertConfigSection,Alerts,Version=1.0.0.0,Culture=neutral,PublicKeyToken=null"/> </configSections> <PhoneNotificationsSection> <phones> <add phone="MyMobile" value="1234567890@vtext.com" /> <add phone="OtherMobile" value="1234567890@txt.att.com" /> </phones> <

How do you load the app.config file into a DLL

我是研究僧i 提交于 2019-12-07 16:14:16
问题 So I cant find a definitive answer to the Question. How do you load the app.config file into a DLL. I understand that generally the App.config info should be put into the executable app.config. However i am building an add-in and have to executable available. I would like to use the namespace.dll.config file to store my variables, but i need a way of loading it into the system. Do you need to build out some code to load this file in? Can you use the configurationManager namespace to make this

Missing <configSections> in config file after deployment

我的未来我决定 提交于 2019-12-07 14:29:50
问题 Update: I had a question below but actually my problem would be solved by asking a slightly different question. Why on some machines does my application throw the error: Configuration system failed to initialize - System.Configuration - at System.Configuration.ConfigurationManager.PrepareConfigSystem() where as on other machines it does not. The error as described also here .NET 3.5 - Configuration system failed to initialize exception is caused by a missing configSections element at the top

How can I convert this app.config WCF Client configuration to code?

孤人 提交于 2019-12-07 13:26:20
问题 I have been provided with the following app.config entry, however I would like to have this as code in my application in order to understand WCF better. Is there a converter anywhere, or can someone provide the code. Thanks. <system.serviceModel> <client> <endpoint name="QA" address="https://subdomain1.theirdomain.com/5067/Sample1" behaviorConfiguration="WSSecBehavior" binding="customBinding" bindingConfiguration="Soap11_Secure" contract="star.starTransportPortTypes" /> <endpoint name="PROD"

How to dynamically set log file using App.config and System.Diagnostics?

点点圈 提交于 2019-12-07 08:28:38
问题 I was looking for a solution to provide logging to my latest project when I came across an article ( http://www.daveoncsharp.com/2009/09/create-a-logger-using-the-trace-listener-in-csharp/ ) that talked about using System.Diagnostics and App.config to log via the Trace method. I was able to successfully implement both the class and the App.config but I'd really like to be able to dynamically assign the value/location (inside initializeData) of the log file and I don't have a clue how to do it