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
720 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
  • 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
ConsoleSql 1 34
bulid json format 3 46
coded character set iptc field within a jpeg 1 68
Vb.net dynamic formulas in runtime 11 61
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…
This article aims to explain the working of CircularLogArchiver. This tool was designed to solve the buildup of log file in cases where systems do not support circular logging or where circular logging is not enabled
This Micro Tutorial will teach you how to censor certain areas of your screen. The example in this video will show a little boy's face being blurred. This will be demonstrated using Adobe Premiere Pro CS6.
This Micro Tutorial hows how you can integrate  Mac OSX to a Windows Active Directory Domain. Apple has made it easy to allow users to bind their macs to a windows domain with relative ease. The following video show how to bind OSX Mavericks to …

912 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

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now