why there is no app.config file in my VB.NET project

  • Thread starter Thread starter z. f.
  • Start date Start date
Z

z. f.

i started a new vb.net console application.

why there is no app.config file in my VB.NET project?

i need to save some configuration data there, can i create this file by myself ( not automatically ) ?



TIA, zigi.
 
why there is no app.config file in my VB.NET project?

Because it's not there (not needed) in the default project.

i need to save some configuration data there, can i create this file by myself ( not automatically ) ?

Yes you can.



Mattias
 
Since when are .config files not XML? If you use
ConfigurationSettings.AppSettings name/value collection or
ConfigurationSettings.GetConfig() to read the custom sections it's a lot
easier and cleaner approach than using XmlDocument directly.

Jerry
 
Jerry,

I am sorry you did not like my comment.

I never said app.config files were not XML. Did you read that somewhere
that I missed in my post?

I feel being able to modify the configuration file at runtime is
essential. It is possible with app.config but not easy. You can do that
using the methods I set out on the web page.

Have a good night.
 
I didn't say I didn't like your comment. But you told that guy to use XML -
well, .config files are XML, so your answer was stating the obvious. Btw
your code can be used to modify .config files, you don't have to create a
separate XML file to be able to do what you're doing.

Jerry
 
You are right. I should have said Use "XmlDocument". I will have to work
on my terminology.

I had to write a separate namespace to write to the config file.
Obviously I missed something there!

Please post a code sample I could see that would use my code to write to
the config file during run time. I would appreciate it very much.
 
I've been following this conversation.

Apparently our anonymous "scorpion" friend here is recommending a particular
class, instead of the built-in config files, because he can WRITE to the
config files from code, in addition to READ from them, using the
aforementioned class.

The code references is simple and clear, and works for occasional writes and
occasional reads (probably the majority of the need for config settings).

That said, there is a nice article and code on a pattern-driven interface
for reading and writing configuration settings, along with an adapter that
will allow the user to WRITE to standard .NET config files, at the following
link.

http://www.codeproject.com/csharp/ReadWriteXmlIni.asp

--- Nick
 
Hi Nick,

My name is Kelly. kjmsolutions.com is my web site. Pleased to meet you.

This is an excellent link thank you.
 
I'm very happy to meet you, Kelly.

--- Nick

scorpion53061 said:
Hi Nick,

My name is Kelly. kjmsolutions.com is my web site. Pleased to meet you.

This is an excellent link thank you.
 
Back
Top