Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

How do I disable the creation of  *.exe.config  file when I am adding a new configuration file app.config in visual studio 2003 .NET Framework v1.1

Posted on 2006-06-25
4
Medium Priority
?
1,198 Views
Last Modified: 2009-07-29
Hello,
After adding an App.config file to a C# .NET Framework v1.1 project in Visual Studio 2003 I noticed that in the debug\bin directory a *.exe.config file was created as well as the App.config file.
I would like to have only the App.config file in my root project directory without the creation of the *.exe.config file.
the * stands for the name of my created assembly file.
So for instance if I have a project with an assembly called MyClass.exe the unwanted file name is MyClass.exe.config.
For a long time I thought that I am having a problem with my C# code or maybe because I have created a ConnectionString and dynamicly mapped it to the App.config file that I have added to my project, but...as it seems, immediately after adding a new configuration file App.config to my project and after that running the project - the *.exe.config file was created in the debug\bin directory.

By the way, even if I am deleting the unwanted configuration file *.exe.config - it is being creted at next time the application is running.

I hope you understood my question. I tried to describe the problem as good as I could.

Regards
yoffir  
0
Comment
Question by:yoffir
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 
LVL 10

Expert Comment

by:athapa
ID: 16980654
If you don't want the *.exe.config file then remove the App.config and recompile. That file is used to store your Application settings. If you don't save/read your settings from config then you can remove the App.config but if you must store your settings and don't want to use that file then you can create your own xml file and save your settings there or store your settings in the registry.

AT
0
 
LVL 41

Expert Comment

by:graye
ID: 16980967
hang on... let's start at the beginning.

The configure file *should* be named the same as the application+".config".   Sure, the Visual Studio IDE creates a "prototype" configuration file called "app.config"... but it renames it appropriately during each compile.  This is normal and should not be the cause for any concern.

In fact, the program will only look for it's configuration file if it is named the same as the application + ".config".  In other words, if you renamed the *.exe.config file to "app.config", the program will never find it.
0
 

Author Comment

by:yoffir
ID: 16982696
So if I get your explenations...the App.config is only used for my convenience at development time, but the actual configuration file that the application uses is the *.exe.config file ?

If so, wich file should i deploy on client PCs ? the *.exe.config or the App.config or both ?

Regards
yoffir
0
 
LVL 41

Accepted Solution

by:
graye earned 2000 total points
ID: 16983985
That's correct...

You should only deploy the *.exe.config version
0

Featured Post

On Demand Webinar: Networking for the Cloud Era

Ready to improve network connectivity? Watch this webinar to learn how SD-WANs and a one-click instant connect tool can boost provisions, deployment, and management of your cloud connection.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

We all know that functional code is the leg that any good program stands on when it comes right down to it, however, if your program lacks a good user interface your product may not have the appeal needed to keep your customers happy. This issue can…
The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
This course is ideal for IT System Administrators working with VMware vSphere and its associated products in their company infrastructure. This course teaches you how to install and maintain this virtualization technology to store data, prevent vuln…
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …

670 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question