473,394 Members | 2,031 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

loading application config files- NOT WORKING!!

I wrote a small application. I created config file as
ConsoleApplication1.exe.config.
1. I have appsettings section.
<configuration>
<appSettings>
<add key="Application Name" value="MyApplication" />
</appSettings>
</configuration>

I cannot load appsettings? Any comments
string appName = ConfigurationSettings.AppSettings["Application Name"];
Console.WriteLine();
Console.WriteLine("Reading AppSettings");
Console.WriteLine("Application Name: " + appName);

I get blanks

2. Also I need to load the custom section to make windows service run after
sometime, which is
<TimerConfig>
<Date between="09/24/2004" and="12/31/2004" />
<Time between="05:00:00AM" and="07:00:00PM" />
<RunEvery>1</RunEvery>
<TimerDuration>1</TimerDuration>
</TimerConfig>

I have written a TimerConfigSectionHandler( implementes
IConfigsectionHandler) to read it but again no luck with this either.

Data.TimerConfig timerConfig =
System.Configuration.ConfigurationSettings.GetConf ig("TimerConfig") as
Data.TimerConfig;

Jul 21 '05 #1
0 1138

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Per Bergland | last post by:
After many woes, I finally managed to get a stack dump of my System Service (written in C#) that insists on crashing when launched at system boot time (see below on how to get this dump - I...
2
by: Tim Blizard | last post by:
I know this topic has been discussed before but I couldn't find any thread more recent than about 18 months and was interested in what conclusions people had come to recently. Invariably 3...
6
by: Ann Marinas | last post by:
Hi, all! I have a question regarding application config files. Is there a possibility that a value from the application config file can be altered within the application itself? If so, how...
6
by: Andrew Connell | last post by:
I have an app where I want virtually everything password protected/secure except for a single directory. That directory handles some custom authentication and contains my login form, but also some...
0
by: helpSeekar | last post by:
I wrote a small application. I created config file as ConsoleApplication1.exe.config. 1. I have appsettings section. <configuration> <appSettings> <add key="Application Name"...
1
by: Anthony Yott | last post by:
Folks this may take a little while to explain but here goes. I've got a VS 2005 .NET C# library (lets call it Elvis.dll because I'm sick of seeing Foo) that I created that will be consumed by...
2
by: OO | last post by:
Hi all, OK loads of posts on here about developers trying to use an app.config for a dll class library. Of course I would normally say the config file is down to the app domain of the...
0
by: hoots | last post by:
The Problem: I want to be able to use an assembly of an independant application which is not strong named from within an SSIS script component. I have created a wrapper assembly (Utils.dll)...
4
by: TS | last post by:
i want to use these but think they may be only windows forms
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.