Config File 
Author Message
 Config File

I want to use a config file for one of my console applications.

I understand that I am supposed to put the AppName.exe.config file in the
bin directory...

But everytime that I compile it disappears...Am I going about this wrong?

Thanks,
Brian



Wed, 16 Nov 2005 03:32:14 GMT  
 Config File
Hello,


Quote:
> I want to use a config file for one of my console applications.

> I understand that I am supposed to put the AppName.exe.config file in
the
> bin directory...

> But everytime that I compile it disappears...Am I going about this

wrong?

Put the config file into your project's directory and add it to the
project.

Regards,
Herfried K. Wagner
--
http://www.mvps.org/dotnet



Wed, 16 Nov 2005 03:37:58 GMT  
 Config File
I actually did....I right clicked on the bin directory...new
item....xml....and named it AppName.exe.cong...

but it disappears everytime that I compile?????



Quote:
> Hello,


> > I want to use a config file for one of my console applications.

> > I understand that I am supposed to put the AppName.exe.config file in
> the
> > bin directory...

> > But everytime that I compile it disappears...Am I going about this
> wrong?

> Put the config file into your project's directory and add it to the
> project.

> Regards,
> Herfried K. Wagner
> --
> http://www.mvps.org/dotnet



Wed, 16 Nov 2005 04:51:29 GMT  
 Config File
appname.exe.config gets created each time you compile.  It is copied from
you app.config file.  Name your file app.config and you should be set.


Quote:
> I actually did....I right clicked on the bin directory...new
> item....xml....and named it AppName.exe.cong...

> but it disappears everytime that I compile?????



> > Hello,


> > > I want to use a config file for one of my console applications.

> > > I understand that I am supposed to put the AppName.exe.config file in
> > the
> > > bin directory...

> > > But everytime that I compile it disappears...Am I going about this
> > wrong?

> > Put the config file into your project's directory and add it to the
> > project.

> > Regards,
> > Herfried K. Wagner
> > --
> > http://www.mvps.org/dotnet



Wed, 16 Nov 2005 05:02:07 GMT  
 Config File
I'm experiencing the same problem that Brian described.  
You should be able to add an application config file, and
then retrieve values from it.  Everything worked okay
with .Net 2002.  Now, however, when I add an app config
file to the \bin folder, it disappears as soon as I Run.  
I'm naming the config file properly (appname.exe.config as
Brian noted).  I'm doing exactly what I did in the prior
version of .Net.  In fact, the first time I noticed this
was with a VB project that I moved from .Net 2002 to .Net
2003.  

Anybody have any ideas?

Quote:
>-----Original Message-----
>appname.exe.config gets created each time you compile.  
It is copied from
>you app.config file.  Name your file app.config and you
should be set.



>> I actually did....I right clicked on the bin
directory...new
>> item....xml....and named it AppName.exe.cong...

>> but it disappears everytime that I compile?????


message

>> > Hello,


>> > > I want to use a config file for one of my console
applications.

>> > > I understand that I am supposed to put the

AppName.exe.config file in

- Show quoted text -

Quote:
>> > the
>> > > bin directory...

>> > > But everytime that I compile it disappears...Am I
going about this
>> > wrong?

>> > Put the config file into your project's directory and
add it to the
>> > project.

>> > Regards,
>> > Herfried K. Wagner
>> > --
>> > http://www.mvps.org/dotnet

>.



Thu, 17 Nov 2005 01:16:23 GMT  
 Config File
Yeah..I had the same problem...but they are right....

I just put the app.config in the root of the project...then when I build
it...it creates the appname.exe.config in the bin directory.

So..just put the app.config in the root directory...and it should work just
fine.


Quote:
> I'm experiencing the same problem that Brian described.
> You should be able to add an application config file, and
> then retrieve values from it.  Everything worked okay
> with .Net 2002.  Now, however, when I add an app config
> file to the \bin folder, it disappears as soon as I Run.
> I'm naming the config file properly (appname.exe.config as
> Brian noted).  I'm doing exactly what I did in the prior
> version of .Net.  In fact, the first time I noticed this
> was with a VB project that I moved from .Net 2002 to .Net
> 2003.

> Anybody have any ideas?

> >-----Original Message-----
> >appname.exe.config gets created each time you compile.
> It is copied from
> >you app.config file.  Name your file app.config and you
> should be set.



> >> I actually did....I right clicked on the bin
> directory...new
> >> item....xml....and named it AppName.exe.cong...

> >> but it disappears everytime that I compile?????


> message

> >> > Hello,


> >> > > I want to use a config file for one of my console
> applications.

> >> > > I understand that I am supposed to put the
> AppName.exe.config file in
> >> > the
> >> > > bin directory...

> >> > > But everytime that I compile it disappears...Am I
> going about this
> >> > wrong?

> >> > Put the config file into your project's directory and
> add it to the
> >> > project.

> >> > Regards,
> >> > Herfried K. Wagner
> >> > --
> >> > http://www.mvps.org/dotnet

> >.



Fri, 18 Nov 2005 09:21:36 GMT  
 Config File
Brian,
I believe MS fixed a 'feature'. :-)

The 'correct' (at least working) way to use app.config files within your
project is to use 'Project - Add New Item - Application Configuration File'.
It will place a file called 'app.config' in your project's root folder. Of
course you can manually add a file to your project call 'app.config' also,
but I find the above a good start...

When VS.NET compiles your project, it will copy the above app.config file to
your bin folder as application_name.exe.config.

This works in both VS.NET 2002 & VS.NET 2003.

The downside to this is if you wrote code to modify the app.config file,
your modifications will be lost.

Hope this helps
Jay


Quote:
> I want to use a config file for one of my console applications.

> I understand that I am supposed to put the AppName.exe.config file in the
> bin directory...

> But everytime that I compile it disappears...Am I going about this wrong?

> Thanks,
> Brian



Sun, 20 Nov 2005 02:00:28 GMT  
 
 [ 7 post ] 

 Relevant Pages 

1. config file get deleted when I compile

2. several config files

3. .config file with smart client

4. CONFIG file rebuilt on every build

5. about app.config file

6. CONFIG files in VStudio 2003

7. Problem with config files in VB.NET 2003

8. Application won't use .config file

9. config file disappears when debuging

10. VB.NET DLL config files

11. User Control and Config File

12. App.Config Files

 

 
Powered by phpBB® Forum Software