Can you tell me how to read and modify a value in the app.config file using
this class?
Thank you very much 8 10157
Hi!
Funny, i am just dealing with a problem related to this.
I cant access the configuration class somehow...
I use the System.Configuration, but for some reason the
System.Configuration.Configuration is not accessible from the
System.Configuration?!? I do have net framework 2 installed...
Any idea?
Regards
Martin
"Dave Sexton" <dave@jwa[remove.this]online.comskrev i meddelandet
news:OF**************@TK2MSFTNGP05.phx.gbl...
Hi,
The online documentation and examples should be more than adequate:
Configuration Class http://msdn2.microsoft.com/en-us/lib...iguration.aspx
If you simply need to read/write data in the appSettings element then you
can use the ConfigurationManager class:
ConfigurationManager Class http://msdn2.microsoft.com/en-us/lib...onmanager.aspx
You may also want to check out Application Settings, new to the 2.0
Framework:
Application Settings Overview http://msdn2.microsoft.com/en-us/library/k4s6c3a0.aspx
--
Dave Sexton http://davesexton.com/blog http://www.codeplex.com/DocProject (Sandcastle in Visual Studio 2005)
"Alberto" <al*****@nospam.eswrote in message
news:eu*************@TK2MSFTNGP02.phx.gbl...
>Can you tell me how to read and modify a value in the app.config file using this class? Thank you very much
Hi Martin,
You can't see it or just can't access it? Realize that the Configuration
class has not static method or properties (other than ReferenceEquals,
inherited from Object). It may be the ConfigurationManager class that
you're after.
If you have added a System.Configuration assembly reference to your project,
then I see no reason why the Configuration class wouldn't be visible in the
code editor. You tried a using directive or fully-qualifying the type name
in code?
Also, Configuration is sealed, and so cannot be inherited. If you're trying
to type it after a ":" then Visual Studio may be excluding it from
IntelliSense.
--
Dave Sexton http://davesexton.com/blog http://www.codeplex.com/DocProject (Sandcastle in Visual Studio 2005)
"Martin Arvidsson, Visual Systems AB" <ma**************@vsab.netwrote in
message news:eP*************@TK2MSFTNGP04.phx.gbl...
Hi!
Funny, i am just dealing with a problem related to this.
I cant access the configuration class somehow...
I use the System.Configuration, but for some reason the
System.Configuration.Configuration is not accessible from the
System.Configuration?!? I do have net framework 2 installed...
Any idea?
Regards
Martin
"Dave Sexton" <dave@jwa[remove.this]online.comskrev i meddelandet
news:OF**************@TK2MSFTNGP05.phx.gbl...
>Hi,
The online documentation and examples should be more than adequate:
Configuration Class http://msdn2.microsoft.com/en-us/lib...iguration.aspx
If you simply need to read/write data in the appSettings element then you can use the ConfigurationManager class:
ConfigurationManager Class http://msdn2.microsoft.com/en-us/lib...onmanager.aspx
You may also want to check out Application Settings, new to the 2.0 Framework:
Application Settings Overview http://msdn2.microsoft.com/en-us/library/k4s6c3a0.aspx
-- Dave Sexton http://davesexton.com/blog http://www.codeplex.com/DocProject (Sandcastle in Visual Studio 2005)
"Alberto" <al*****@nospam.eswrote in message news:eu*************@TK2MSFTNGP02.phx.gbl...
>>Can you tell me how to read and modify a value in the app.config file using this class? Thank you very much
Hi!
I have tried to use the folowing.
* Use System.Configuration;
* System.Configuration.Configuration config = xxxxxx; (xxx = other code)
For some darn reason it just wont come up. if i compile i get an error.
I have made sure i have the latest .NET Framework 2 and that the project
uses the .NET 2 Framework.
Regards
Martin
"Dave Sexton" <dave@jwa[remove.this]online.comskrev i meddelandet
news:eH**************@TK2MSFTNGP02.phx.gbl...
Hi Martin,
You can't see it or just can't access it? Realize that the Configuration
class has not static method or properties (other than ReferenceEquals,
inherited from Object). It may be the ConfigurationManager class that
you're after.
If you have added a System.Configuration assembly reference to your
project, then I see no reason why the Configuration class wouldn't be
visible in the code editor. You tried a using directive or
fully-qualifying the type name in code?
Also, Configuration is sealed, and so cannot be inherited. If you're
trying to type it after a ":" then Visual Studio may be excluding it from
IntelliSense.
--
Dave Sexton http://davesexton.com/blog http://www.codeplex.com/DocProject (Sandcastle in Visual Studio 2005)
"Martin Arvidsson, Visual Systems AB" <ma**************@vsab.netwrote in
message news:eP*************@TK2MSFTNGP04.phx.gbl...
>Hi!
Funny, i am just dealing with a problem related to this.
I cant access the configuration class somehow...
I use the System.Configuration, but for some reason the System.Configuration.Configuration is not accessible from the System.Configuration?!? I do have net framework 2 installed...
Any idea?
Regards Martin
"Dave Sexton" <dave@jwa[remove.this]online.comskrev i meddelandet news:OF**************@TK2MSFTNGP05.phx.gbl...
>>Hi,
The online documentation and examples should be more than adequate:
Configuration Class http://msdn2.microsoft.com/en-us/lib...iguration.aspx
If you simply need to read/write data in the appSettings element then you can use the ConfigurationManager class:
ConfigurationManager Class http://msdn2.microsoft.com/en-us/lib...onmanager.aspx
You may also want to check out Application Settings, new to the 2.0 Framework:
Application Settings Overview http://msdn2.microsoft.com/en-us/library/k4s6c3a0.aspx
-- Dave Sexton http://davesexton.com/blog http://www.codeplex.com/DocProject (Sandcastle in Visual Studio 2005)
"Alberto" <al*****@nospam.eswrote in message news:eu*************@TK2MSFTNGP02.phx.gbl... Can you tell me how to read and modify a value in the app.config file using this class? Thank you very much
Ill throw in the compiler error as well:
Error 1 The type or namespace name 'Configuration' does not exist in the
namespace 'System.Configuration' (are you missing an assembly reference?)
And the declared line is:
public void OpenFile()
{
System.Configuration.Configuration config;
}
(The last Configuration is underlined by the compiler...)
Regards
Martin
"Martin Arvidsson, Visual Systems AB" <ma**************@vsab.netskrev i
meddelandet news:Oc**************@TK2MSFTNGP02.phx.gbl...
Hi!
I have tried to use the folowing.
* Use System.Configuration;
* System.Configuration.Configuration config = xxxxxx; (xxx = other code)
For some darn reason it just wont come up. if i compile i get an error.
I have made sure i have the latest .NET Framework 2 and that the project
uses the .NET 2 Framework.
Regards
Martin
"Dave Sexton" <dave@jwa[remove.this]online.comskrev i meddelandet
news:eH**************@TK2MSFTNGP02.phx.gbl...
>Hi Martin,
You can't see it or just can't access it? Realize that the Configuration class has not static method or properties (other than ReferenceEquals, inherited from Object). It may be the ConfigurationManager class that you're after.
If you have added a System.Configuration assembly reference to your project, then I see no reason why the Configuration class wouldn't be visible in the code editor. You tried a using directive or fully-qualifying the type name in code?
Also, Configuration is sealed, and so cannot be inherited. If you're trying to type it after a ":" then Visual Studio may be excluding it from IntelliSense.
-- Dave Sexton http://davesexton.com/blog http://www.codeplex.com/DocProject (Sandcastle in Visual Studio 2005)
"Martin Arvidsson, Visual Systems AB" <ma**************@vsab.netwrote in message news:eP*************@TK2MSFTNGP04.phx.gbl...
>>Hi!
Funny, i am just dealing with a problem related to this.
I cant access the configuration class somehow...
I use the System.Configuration, but for some reason the System.Configuration.Configuration is not accessible from the System.Configuration?!? I do have net framework 2 installed...
Any idea?
Regards Martin
"Dave Sexton" <dave@jwa[remove.this]online.comskrev i meddelandet news:OF**************@TK2MSFTNGP05.phx.gbl... Hi,
The online documentation and examples should be more than adequate:
Configuration Class http://msdn2.microsoft.com/en-us/lib...iguration.aspx
If you simply need to read/write data in the appSettings element then you can use the ConfigurationManager class:
ConfigurationManager Class http://msdn2.microsoft.com/en-us/lib...onmanager.aspx
You may also want to check out Application Settings, new to the 2.0 Framework:
Application Settings Overview http://msdn2.microsoft.com/en-us/library/k4s6c3a0.aspx
-- Dave Sexton http://davesexton.com/blog http://www.codeplex.com/DocProject (Sandcastle in Visual Studio 2005)
"Alberto" <al*****@nospam.eswrote in message news:eu*************@TK2MSFTNGP02.phx.gbl... Can you tell me how to read and modify a value in the app.config file using this class? Thank you very much >
Hi Martin,
You're sure that you have referenced the System.Configuration assembly in
your project from the .NET tab?
Try opening the object browser and expand the System.Configuration node.
Can you find the Configuration class in there? (If you can't find the
System.Configuration namespace then the assembly probably isn't referenced
by any of your projects).
--
Dave Sexton http://davesexton.com/blog http://www.codeplex.com/DocProject (Sandcastle in Visual Studio 2005)
"Martin Arvidsson, Visual Systems AB" <ma**************@vsab.netwrote in
message news:eR**************@TK2MSFTNGP05.phx.gbl...
Ill throw in the compiler error as well:
Error 1 The type or namespace name 'Configuration' does not exist in the
namespace 'System.Configuration' (are you missing an assembly reference?)
And the declared line is:
public void OpenFile()
{
System.Configuration.Configuration config;
}
(The last Configuration is underlined by the compiler...)
Regards
Martin
"Martin Arvidsson, Visual Systems AB" <ma**************@vsab.netskrev i
meddelandet news:Oc**************@TK2MSFTNGP02.phx.gbl...
>Hi!
I have tried to use the folowing.
* Use System.Configuration; * System.Configuration.Configuration config = xxxxxx; (xxx = other code)
For some darn reason it just wont come up. if i compile i get an error.
I have made sure i have the latest .NET Framework 2 and that the project uses the .NET 2 Framework.
Regards Martin
"Dave Sexton" <dave@jwa[remove.this]online.comskrev i meddelandet news:eH**************@TK2MSFTNGP02.phx.gbl...
>>Hi Martin,
You can't see it or just can't access it? Realize that the Configuration class has not static method or properties (other than ReferenceEquals, inherited from Object). It may be the ConfigurationManager class that you're after.
If you have added a System.Configuration assembly reference to your project, then I see no reason why the Configuration class wouldn't be visible in the code editor. You tried a using directive or fully-qualifying the type name in code?
Also, Configuration is sealed, and so cannot be inherited. If you're trying to type it after a ":" then Visual Studio may be excluding it from IntelliSense.
-- Dave Sexton http://davesexton.com/blog http://www.codeplex.com/DocProject (Sandcastle in Visual Studio 2005)
"Martin Arvidsson, Visual Systems AB" <ma**************@vsab.netwrote in message news:eP*************@TK2MSFTNGP04.phx.gbl... Hi!
Funny, i am just dealing with a problem related to this.
I cant access the configuration class somehow...
I use the System.Configuration, but for some reason the System.Configuration.Configuration is not accessible from the System.Configuration?!? I do have net framework 2 installed...
Any idea?
Regards Martin
"Dave Sexton" <dave@jwa[remove.this]online.comskrev i meddelandet news:OF**************@TK2MSFTNGP05.phx.gbl... Hi, > The online documentation and examples should be more than adequate: > Configuration Class http://msdn2.microsoft.com/en-us/lib...iguration.aspx > If you simply need to read/write data in the appSettings element then you can use the ConfigurationManager class: > ConfigurationManager Class http://msdn2.microsoft.com/en-us/lib...onmanager.aspx > You may also want to check out Application Settings, new to the 2.0 Framework: > Application Settings Overview http://msdn2.microsoft.com/en-us/library/k4s6c3a0.aspx > -- Dave Sexton http://davesexton.com/blog http://www.codeplex.com/DocProject (Sandcastle in Visual Studio 2005) > "Alberto" <al*****@nospam.eswrote in message news:eu*************@TK2MSFTNGP02.phx.gbl... >Can you tell me how to read and modify a value in the app.config file >using this class? >Thank you very much >> > >
Well. that was an experience...
Isn't all assemblies loaded for Visual Studio to use?
When i added it it worked like charm :)
Thanx!
/Martin
"Dave Sexton" <dave@jwa[remove.this]online.comskrev i meddelandet
news:%2****************@TK2MSFTNGP03.phx.gbl...
Hi Martin,
You're sure that you have referenced the System.Configuration assembly in
your project from the .NET tab?
Try opening the object browser and expand the System.Configuration node.
Can you find the Configuration class in there? (If you can't find the
System.Configuration namespace then the assembly probably isn't referenced
by any of your projects).
--
Dave Sexton http://davesexton.com/blog http://www.codeplex.com/DocProject (Sandcastle in Visual Studio 2005)
"Martin Arvidsson, Visual Systems AB" <ma**************@vsab.netwrote in
message news:eR**************@TK2MSFTNGP05.phx.gbl...
>Ill throw in the compiler error as well:
Error 1 The type or namespace name 'Configuration' does not exist in the namespace 'System.Configuration' (are you missing an assembly reference?)
And the declared line is:
public void OpenFile() { System.Configuration.Configuration config; }
(The last Configuration is underlined by the compiler...)
Regards Martin
"Martin Arvidsson, Visual Systems AB" <ma**************@vsab.netskrev i meddelandet news:Oc**************@TK2MSFTNGP02.phx.gbl...
>>Hi!
I have tried to use the folowing.
* Use System.Configuration; * System.Configuration.Configuration config = xxxxxx; (xxx = other code)
For some darn reason it just wont come up. if i compile i get an error.
I have made sure i have the latest .NET Framework 2 and that the project uses the .NET 2 Framework.
Regards Martin
"Dave Sexton" <dave@jwa[remove.this]online.comskrev i meddelandet news:eH**************@TK2MSFTNGP02.phx.gbl... Hi Martin,
You can't see it or just can't access it? Realize that the Configuration class has not static method or properties (other than ReferenceEquals, inherited from Object). It may be the ConfigurationManager class that you're after.
If you have added a System.Configuration assembly reference to your project, then I see no reason why the Configuration class wouldn't be visible in the code editor. You tried a using directive or fully-qualifying the type name in code?
Also, Configuration is sealed, and so cannot be inherited. If you're trying to type it after a ":" then Visual Studio may be excluding it from IntelliSense.
-- Dave Sexton http://davesexton.com/blog http://www.codeplex.com/DocProject (Sandcastle in Visual Studio 2005)
"Martin Arvidsson, Visual Systems AB" <ma**************@vsab.netwrote in message news:eP*************@TK2MSFTNGP04.phx.gbl... Hi! > Funny, i am just dealing with a problem related to this. > I cant access the configuration class somehow... > I use the System.Configuration, but for some reason the System.Configuration.Configuration is not accessible from the System.Configuration?!? I do have net framework 2 installed... > Any idea? > Regards Martin > "Dave Sexton" <dave@jwa[remove.this]online.comskrev i meddelandet news:OF**************@TK2MSFTNGP05.phx.gbl.. . >Hi, >> >The online documentation and examples should be more than adequate: >> >Configuration Class >http://msdn2.microsoft.com/en-us/lib...iguration.aspx >> >If you simply need to read/write data in the appSettings element then >you can use the ConfigurationManager class: >> >ConfigurationManager Class >http://msdn2.microsoft.com/en-us/lib...onmanager.aspx >> >You may also want to check out Application Settings, new to the 2.0 >Framework: >> >Application Settings Overview >http://msdn2.microsoft.com/en-us/library/k4s6c3a0.aspx >> >-- >Dave Sexton >http://davesexton.com/blog >http://www.codeplex.com/DocProject (Sandcastle in Visual Studio 2005) >> >"Alberto" <al*****@nospam.eswrote in message >news:eu*************@TK2MSFTNGP02.phx.gbl.. . >>Can you tell me how to read and modify a value in the app.config >>file using this class? >>Thank you very much >>> >> >> > >
Hi Martin,
Isn't all assemblies loaded for Visual Studio to use?
The C# compiler references mscorlib automatically, by default. Visual
Studio may add some references for you to new projects created by a
particular template. For instance, a new WinForms project will have a
reference to System.Windows.Forms.dll. You have to add any references that
Visual Studio doesn't add for you.
--
Dave Sexton http://davesexton.com/blog http://www.codeplex.com/DocProject (Sandcastle in Visual Studio 2005)
"Martin Arvidsson, Visual Systems AB" <ma**************@vsab.netwrote in
message news:O5*************@TK2MSFTNGP05.phx.gbl...
Well. that was an experience...
Isn't all assemblies loaded for Visual Studio to use?
When i added it it worked like charm :)
Thanx!
/Martin
"Dave Sexton" <dave@jwa[remove.this]online.comskrev i meddelandet
news:%2****************@TK2MSFTNGP03.phx.gbl...
>Hi Martin,
You're sure that you have referenced the System.Configuration assembly in your project from the .NET tab?
Try opening the object browser and expand the System.Configuration node. Can you find the Configuration class in there? (If you can't find the System.Configuration namespace then the assembly probably isn't referenced by any of your projects).
-- Dave Sexton http://davesexton.com/blog http://www.codeplex.com/DocProject (Sandcastle in Visual Studio 2005)
"Martin Arvidsson, Visual Systems AB" <ma**************@vsab.netwrote in message news:eR**************@TK2MSFTNGP05.phx.gbl...
>>Ill throw in the compiler error as well:
Error 1 The type or namespace name 'Configuration' does not exist in the namespace 'System.Configuration' (are you missing an assembly reference?)
And the declared line is:
public void OpenFile() { System.Configuration.Configuration config; }
(The last Configuration is underlined by the compiler...)
Regards Martin
"Martin Arvidsson, Visual Systems AB" <ma**************@vsab.netskrev i meddelandet news:Oc**************@TK2MSFTNGP02.phx.gbl... Hi!
I have tried to use the folowing.
* Use System.Configuration; * System.Configuration.Configuration config = xxxxxx; (xxx = other code)
For some darn reason it just wont come up. if i compile i get an error.
I have made sure i have the latest .NET Framework 2 and that the project uses the .NET 2 Framework.
Regards Martin
"Dave Sexton" <dave@jwa[remove.this]online.comskrev i meddelandet news:eH**************@TK2MSFTNGP02.phx.gbl... Hi Martin, > You can't see it or just can't access it? Realize that the Configuration class has not static method or properties (other than ReferenceEquals, inherited from Object). It may be the ConfigurationManager class that you're after. > If you have added a System.Configuration assembly reference to your project, then I see no reason why the Configuration class wouldn't be visible in the code editor. You tried a using directive or fully-qualifying the type name in code? > Also, Configuration is sealed, and so cannot be inherited. If you're trying to type it after a ":" then Visual Studio may be excluding it from IntelliSense. > -- Dave Sexton http://davesexton.com/blog http://www.codeplex.com/DocProject (Sandcastle in Visual Studio 2005) > "Martin Arvidsson, Visual Systems AB" <ma**************@vsab.net> wrote in message news:eP*************@TK2MSFTNGP04.phx.gbl... >Hi! >> >Funny, i am just dealing with a problem related to this. >> >I cant access the configuration class somehow... >> >I use the System.Configuration, but for some reason the >System.Configuration.Configuration is not accessible from the >System.Configuration?!? I do have net framework 2 installed... >> >Any idea? >> >Regards >Martin >> >"Dave Sexton" <dave@jwa[remove.this]online.comskrev i meddelandet >news:OF**************@TK2MSFTNGP05.phx.gbl. .. >>Hi, >>> >>The online documentation and examples should be more than adequate: >>> >>Configuration Class >>http://msdn2.microsoft.com/en-us/lib...iguration.aspx >>> >>If you simply need to read/write data in the appSettings element >>then you can use the ConfigurationManager class: >>> >>ConfigurationManager Class >>http://msdn2.microsoft.com/en-us/lib...onmanager.aspx >>> >>You may also want to check out Application Settings, new to the 2.0 >>Framework: >>> >>Application Settings Overview >>http://msdn2.microsoft.com/en-us/library/k4s6c3a0.aspx >>> >>-- >>Dave Sexton >>http://davesexton.com/blog >>http://www.codeplex.com/DocProject (Sandcastle in Visual Studio >>2005) >>> >>"Alberto" <al*****@nospam.eswrote in message >>news:eu*************@TK2MSFTNGP02.phx.gbl. .. >>>Can you tell me how to read and modify a value in the app.config >>>file using this class? >>>Thank you very much >>>> >>> >>> >> >> > > This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: phillip |
last post by:
This is interesting, I have attached my web.config file and the
exception I have been logging. I created a library which provide data
access to a database and a control system. The library is...
|
by: hB |
last post by:
Hi.
Error = "The configuration system can only be set once. Configuration
system is already set"
Exception Details: System.InvalidOperationException: The
configuration
system can only...
|
by: Michael Schwarz |
last post by:
Hi,
from time to time I get following error message with my ASP.NET 2.0 web
application in the event log: An error occurred executing the configuration
section handler for system.web/identity.
...
|
by: Michael Lang |
last post by:
I was basically wanting to know how to use the System.Configuration
namespace to be able to load an arbitrary number of unknown attributes on an
element in a custom section in the .config into a...
|
by: Jeff Hegedus |
last post by:
I have a dll that requires some configuration data. I put the configuration
data in a custom configuration section in a config file that is loaded in
the installation folder of the dll. If I...
|
by: =?Utf-8?B?Uml0YUc=?= |
last post by:
Hello.
I'm trying to capture/determine in code the
System.Web.Configuration.AuthenticationMode.
I found an example on the Internet but when I added it to my code I received
a build error....
|
by: Rob Schieber |
last post by:
Hi,
I would like to create a centeralized configuration system for our company's
..net projects. Unfortunately this has been nearly impossible to do thanks
to the current .net Configuration...
|
by: Mike |
last post by:
Hi
I have problem as folow:
Caught Exception: System.Configuration.ConfigurationErrorsException:
An error occurred loading a configuration file: Request for the
permission of type...
|
by: =?Utf-8?B?QWxoYW1icmEgRWlkb3MgRGVzYXJyb2xsbw==?= |
last post by:
Hi, thanks, mister
The code
string rutaConfig = tbRutaConfigServicioBase.Text;
'// Map to the application configuration file.
ExeConfigurationFileMap configFile = New...
|
by: lllomh |
last post by:
Define the method first
this.state = {
buttonBackgroundColor: 'green',
isBlinking: false, // A new status is added to identify whether the button is blinking or not
}
autoStart=()=>{
|
by: isladogs |
last post by:
The next Access Europe meeting will be on Wednesday 4 Oct 2023 starting at 18:00 UK time (6PM UTC+1) and finishing at about 19:15 (7.15PM)
The start time is equivalent to 19:00 (7PM) in Central...
|
by: Aliciasmith |
last post by:
In an age dominated by smartphones, having a mobile app for your business is no longer an option; it's a necessity. Whether you're a startup or an established enterprise, finding the right mobile app...
|
by: giovanniandrean |
last post by:
The energy model is structured as follows and uses excel sheets to give input data:
1-Utility.py contains all the functions needed to calculate the variables and other minor things (mentions...
|
by: Teri B |
last post by:
Hi, I have created a sub-form Roles. In my course form the user selects the roles assigned to the course.
0ne-to-many. One course many roles.
Then I created a report based on the Course form and...
|
by: nia12 |
last post by:
Hi there,
I am very new to Access so apologies if any of this is obvious/not clear.
I am creating a data collection tool for health care employees to complete. It consists of a number of...
|
by: NeoPa |
last post by:
Introduction
For this article I'll be focusing on the Report (clsReport) class. This simply handles making the calling Form invisible until all of the Reports opened by it have been closed, when it...
|
by: isladogs |
last post by:
The next online meeting of the Access Europe User Group will be on Wednesday 6 Dec 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM).
In this month's session, Mike...
|
by: SueHopson |
last post by:
Hi All,
I'm trying to create a single code (run off a button that calls the Private Sub) for our parts list report that will allow the user to filter by either/both PartVendor and PartType. On...
| |