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
879 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 500 total points
ID: 16983985
That's correct...

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

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Article by: Najam
Having new technologies does not mean they will completely replace old components.  Recently I had to create WCF that will be called by VB6 component.  Here I will describe what steps one should follow while doing so, please feel free to post any qu…
Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
Are you ready to implement Active Directory best practices without reading 300+ pages? You're in luck. In this webinar hosted by Skyport Systems, you gain insight into Microsoft's latest comprehensive guide, with tips on the best and easiest way…

734 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