473,385 Members | 1,829 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,385 software developers and data experts.

System.Configuration namespace

HI,
Sorry if this is a bit long winded
I'm working on a suite of winapps that need to use two levels of
configuration data; application level and solution level.

I found a reference on MSDN that suggested that app.config file can import
data from another file at runtime.
http://msdn.microsoft.com/library/de...l/tdlg_ch4.asp

So I created a solution and added app.config and user.config as follows

app.config file contains
<configuration>
<appSettings file="user.config">
<add key="testKey" value="Got test key"/>
</appSettings>
</configuration>

user.config file contains
<appSettings>
<add key="ConnectionString" value="Connect String"/>
</appSettings>

I added to my form

Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load

MsgBox(System.Configuration.ConfigurationSettings. AppSettings("ConnectionStr
ing"), MsgBoxStyle.OKOnly)

MsgBox(System.Configuration.ConfigurationSettings. AppSettings("testKey"),
MsgBoxStyle.OKOnly)
End Sub

I expected to see
Connect String
Got test key

I get
<blank>
Got test key

Should this work?

TIA Steve
Jul 21 '05 #1
4 1699
Hi Steve,

Currently I am looking for somebody who could help you on it. We will reply
here with more information as soon as possible.
If you have any more concerns on it, please feel free to post here.
Thanks for your understanding!

Best regards,

Gary Chang
Microsoft Online Partner Support

Get Secure! - www.microsoft.com/security
This posting is provided "AS IS" with no warranties, and confers no rights.
--------------------

Jul 21 '05 #2
Hi Steve,

Currently I am looking for somebody who could help you on it. We will reply
here with more information as soon as possible.
If you have any more concerns on it, please feel free to post here.
Thanks for your understanding!

Best regards,

Gary Chang
Microsoft Online Partner Support

Get Secure! - www.microsoft.com/security
This posting is provided "AS IS" with no warranties, and confers no rights.
--------------------

Jul 21 '05 #3
Thanks Gary,

It was a holiday weekend here so I've only just got back to this.
I does work, the problem was that "user.config" was not copied to the
directory with the .exe and therefore not found.

Steve

"Gary Chang" <v-******@online.microsoft.com> wrote in message
news:Cp**************@cpmsftngxa10.phx.gbl...
Hi Steve,

Currently I am looking for somebody who could help you on it. We will reply here with more information as soon as possible.
If you have any more concerns on it, please feel free to post here.
Thanks for your understanding!

Best regards,

Gary Chang
Microsoft Online Partner Support

Get Secure! - www.microsoft.com/security
This posting is provided "AS IS" with no warranties, and confers no rights. --------------------

Jul 21 '05 #4
Thanks Gary,

It was a holiday weekend here so I've only just got back to this.
I does work, the problem was that "user.config" was not copied to the
directory with the .exe and therefore not found.

Steve

"Gary Chang" <v-******@online.microsoft.com> wrote in message
news:Cp**************@cpmsftngxa10.phx.gbl...
Hi Steve,

Currently I am looking for somebody who could help you on it. We will reply here with more information as soon as possible.
If you have any more concerns on it, please feel free to post here.
Thanks for your understanding!

Best regards,

Gary Chang
Microsoft Online Partner Support

Get Secure! - www.microsoft.com/security
This posting is provided "AS IS" with no warranties, and confers no rights. --------------------

Jul 21 '05 #5

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

Similar topics

2
by: John Chrisman | last post by:
I get the above error message as well as a complaint about the RunInstallerAttribute not being found when compiling the following code. This couldn't be any simpler and I see examples on the web...
0
by: cyberstrike | last post by:
In the system.configuration namespace, is there any way to save a Dataset or any other custom structure in a section? I know how to make a class and derive it from the section class; however, any...
0
by: Kirk | last post by:
I'm trying to use a Web Service to be a Remoting client of an existing ..NET 2.0 server. But I get the following error when I try to use System.Runtime.Remoting.Channels.Http in my WebService. ...
0
by: Jim Duffie | last post by:
Hi, I am trying to build a simple websire using the above in Visual Web Developer. When finished I have build the website and it works fine locally but when I FTP it to the server I am getting a...
2
by: AnalogKid17 | last post by:
Keywords: ASP.NET app with VS2005 running on Win2003 with IIS6, and SQL2000 on a WinXP Box I've betting the following for days... it's driving me insane: Server Error in '/' Application. ...
9
by: Arpan | last post by:
If I am not wrong, System.IO is one of the seven namespaces that get imported in all ASP.NET page automatically but in the following code: <%@ Import Namespace="System.IO" %> <script...
8
by: Alberto | last post by:
Can you tell me how to read and modify a value in the app.config file using this class? Thank you very much
4
by: Dariusz Tomon | last post by:
Hello I upgraded my project from Visual Studio 2003 to 2005. The upgrade was performed with no errors but now when I try to build my project (now it's in ..NET 2.0 not .NET 1.1 as was...
1
by: =?Utf-8?B?Vmlua2k=?= | last post by:
I keep getting this warining in my code, but when i tried to look at the intellisense after system.configuration. , I couldn't find configurationManager but when i forced to put...
8
by: =?Utf-8?B?TWFuanJlZSBHYXJn?= | last post by:
Hi, I created a web service and hosted it in Windows Services. It is working fine. Now I am trying to implement the X509 certificates for message layer security. But it is throwing the following...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
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...

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.