473,321 Members | 1,669 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,321 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 1695
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: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

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.