Configuration files

  • Thread starter Thread starter craig
  • Start date Start date
C

craig

Does anyone know how to add an application configuration file to a C#
project from within Visual Studio 2003?

Thanks!
 
When I go to the utility folder, I don't find and Application Configuration
File template.

All I find is:
-Text File
-Crystal Report
-JScript File
-VBScript File
-Windows Script Host
 
I usually add a new text file or XML file to the project
called "app.config" and VS.NET will figure out it's an
XML config file.

When you build, VS.NET will copy the app.config file
to the bin directory with the name [executable].exe.config
automatically.

But I was under the impression that there exists a template that includes
many of the common XML application configuration tags.
 
The App Config file template is available under VB projects but not C#
projects, AFAIK.

This is the starter code that template provides:
<?xml version="1.0" encoding="utf-8" ?>

<configuration>

</configuration>


craig said:
I usually add a new text file or XML file to the project
called "app.config" and VS.NET will figure out it's an
XML config file.

When you build, VS.NET will copy the app.config file
to the bin directory with the name [executable].exe.config
automatically.

But I was under the impression that there exists a template that includes
many of the common XML application configuration tags.
 
Thanks!
Not much of a template, is it!

Gregory Persson said:
The App Config file template is available under VB projects but not C#
projects, AFAIK.

This is the starter code that template provides:
<?xml version="1.0" encoding="utf-8" ?>

<configuration>

</configuration>


craig said:
I usually add a new text file or XML file to the project
called "app.config" and VS.NET will figure out it's an
XML config file.

When you build, VS.NET will copy the app.config file
to the bin directory with the name [executable].exe.config
automatically.

But I was under the impression that there exists a template that includes
many of the common XML application configuration tags.
 
craig said:
Thanks!
Not much of a template, is it!

No, it's not, but there's nothing stopping you from changing the template.

The template used by VB.NET projects is located here:
[install drive]\Program Files\Microsoft Visual Studio .NET
2003\Vb7\VBWizards\AppConfiguration\Templates\1033\app.config

It's also possible to add a template for use by C# projects without too much
trouble.

Good luck,
Ryan LaNeve
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top