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
690 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

What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Suggested Solutions

This article introduced a TextBox that supports transparent background.   Introduction TextBox is the most widely used control component in GUI design. Most GUI controls do not support transparent background and more or less do not have the…
Performance in games development is paramount: every microsecond counts to be able to do everything in less than 33ms (aiming at 16ms). C# foreach statement is one of the worst performance killers, and here I explain why.
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…

758 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

17 Experts available now in Live!

Get 1:1 Help Now