Go Premium for a chance to win a PS4. Enter to Win

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,389 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 2000 total points
ID: 16983985
That's correct...

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

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

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

Summary: Persistence is the capability of an application to store the state of objects and recover it when necessary. This article compares the two common types of serialization in aspects of data access, readability, and runtime cost. A ready-to…
Introduction Hi all and welcome to my first article on Experts Exchange. A while ago, someone asked me if i could do some tutorials on object oriented programming. I decided to do them on C#. Now you may ask me, why's that? Well, one of the re…
Are you ready to place your question in front of subject-matter experts for more timely responses? With the release of Priority Question, Premium Members, Team Accounts and Qualified Experts can now identify the emergent level of their issue, signal…
Is your data getting by on basic protection measures? In today’s climate of debilitating malware and ransomware—like WannaCry—that may not be enough. You need to establish more than basics, like a recovery plan that protects both data and endpoints.…
Suggested Courses

877 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