.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
david stephan
Gaurav Pal
Post New Web Links

Why is there 2 configuration files in an application

Posted By:      Posted Date: October 03, 2010    Points: 0   Category :.NET Framework


every time I add an App.config file to my Windows forms application ,visual studio adds 2 configuration files, the first one is called App.config which gets added into the project folder  , and the second one has the same name as the executable file with the extension ".exe.config" and it gets added into the debug folder. for example if my windows forms application name is Test_App then the other configuration file name would be "Test_App.exe.config" .

why is there 2 configuration files >> App.connfig that never gets changed and Test_App.exe.config ?

At runtime when my application executes code that modifies the application configurations ,the file that gets modified is Test_App.exe.config not App.config which is located in the project folder so why is it there if it's not used?

thanks ;



View Complete Post

More Related Resource Links

Managing Custom Configuration Options for a SharePoint Application

Learn how to store configuration data in various ways, including inside the web.config file on front-end Web servers, by using the property bag on various Windows SharePoint Services objects, storing configuration data within SharePoint lists, and by using the hierarchical object storage.

Where is developed under the vs2005 WCF example, and is used in configuration files?

Where is developed under the vs2005 WCF example, and is used in configuration files?

configuration files

Hi I went to a website and wanted to be put on their email list but when I clicked on their join button it said that the configuration file could'nt be opend can I correct this I have windows xp home 32 bit Thankyou Tim

using application configuration file in AppData special folder

Hi! So I understand it is a best practice to save the application configuration files under the AppData folder, rather than in Program Files, since UAC will restrict write acces to the Program Files folder, which is fine. Now, saving the configuration file to another location is no problem, using the SaveAs method. However, when I load the application, I expect some settings to be read. From what I know, this is done either using direct calls to the ConfigurationManager class, either initializing a Configuration object. For the first case, a example is this: if (ConfigurationManager.AppSettings["Title"] != null) { this.Title = ConfigurationManager.AppSettings["Title"]; titleTextBox.Text = ConfigurationManager.AppSettings["Title"]; } For the second case, I would use it like this: Configuration config = ConfigurationManager.OpenExeConfiguration( ConfigurationUserLevel.None); string setting = config.AppSettings.Settings["Title"].Value.ToString(); So, if the application runs in the Program Files folder, an exception is thrown when I save the file. However, if I save the file using SaveAs and save it to AppData folder, obviously, when loading, the settings are not loaded from the AppData folder, but from the configuration file existing in the Program Files folder. One way to solve

External Code Assemblies, Report Subscriptions, and configuration files

I've got a report that relies on a very small external assembly for data for one of its fields.  That assembly, in turn, relies on some values from System.Configuration for portions of its work. I have the configuration keys and values running fine in the web interface, set up in web.config, but when users set up subscriptions for the report it runs fine but doesn't retrieve the configuration values from web.config (as expected) nor does it retrieve them from rsreportserver.config, where I have tried them in the root of the config file as <add key=... /> entries and also by wrapping them inside an <appSettings /> node.  I have also tried them in an appropriately-name config file in the bin directory.  In all cases the report is fine except the field that relies on the external assembly, where I recieve an error indicating that there's missing information (the config vals are used in a String.Format() call): Value cannot be null. Parameter name: format at System.String.Format(IFormatProvider provider, String format, Object[] args) at ExternalDBFunctions.ExternalSelectors.GetNotificationStati(String NotificationID) mscorlib When I remove the config values from the web.config, the web interface shows exactly the same error. Where should these configuration values go?

Masterpage didnt get applied to a particular _Layouts files(application page) for EditUserPref.asp

Master page did nt  get applied to a application page  (_layout file),   but other layout pages have the master page applied. EditUserPref.aspx  ->  Im accessing from search preference - http://i34.tinypic.com/34xi9t5.jpg  

Multiple configuration files.


I have an application that is deployed into multiple machines and each machine requires a number of specific configuration entries. I was hoping to pick the brains of this group for the best way to mange configuration entries (connection strings, app settings, sevice model, etc.) for multiple machines. I was hoping to have a configuration file that changing one entry would change all of the configuration settings that the application sees. Best would be for the application to "auto detect" the "right" configuration entries but I would be happy if I could limit the configuration edits to one entry. Ideas?

Thank you.


Application Page development: deployment of files


If I develop a 2010 Application page using VS2010 and an Empty Sharepoint Project to which I add an Application Page item, the aspx page  oes under the 14 hive \Layouts folder in a subfolder of my naming. The code behind goes into the resulting assembly which I choose to deploy to the GAC.

But say my aspx page has accompanying XSLT files - what is the correct location for those files?

Access to update application files stored in Program Files, restricted on a Windows 7 device when us


Hi all,


I'm here to solve a problem, and that is our application, which speaks to a central server on startup, checks for updates and if found, updates its local files (stored in Program Files) with those pushed from the central server.  Currently, we are getting access denied exception when this updater tries to add/edit files in this special directory.  What I am looking for is a way to accomplish this updating process without moving these application files to a different location.

SSIS configuration files



Does anyone know if I can use SSIS configuration files to map a network drive?

Any help would be appreciated


Dave SQL Developer

Excluding Files From Different Configuration Settings


Hey dudes,

Does anyone know how I can exclude certain folders and files from certain builds? Essentially I've got test code that needs to be deployed to the testing server - but obviously not the real server. This is in both files and folders.

Using the configuration manager profiles, I would like to create a profile for each scenario, and tell it what files it does not need.


Reloading and refreshing flash files inside a windows form in wpf application


I have a app which shows load a flash movie in form, using this code

axShockwaveFlash1 = new AxShockwaveFlashObjects.AxShockwaveFlash()


The problem is that whenever I make a changes in the flash hosted in our application and try to refresh the to see the changes, the new changes is 'messed' up. to be more specific , it seems that the background and some controls of the previous flash still remain, 'spoiling' the new flash that is loaded. why?

Using the following methods before loading the second flash video makes no difference

axShockwaveFlash1.Refresh(); axShockwaveFlash1.Stop();

Even I tried  loading "empty" flash video before loading your new video?

axShockwaveFlash1.LoadMovie(0,""); but nothing worked

Its urgent.Could somebody h

How to specialize the path of configuration file which the application about to read?


Simplily, i have a solution which can be normally run, but after i renamed the app.config to otherName.config, the app would not file the configuration file at its runtime. so how to specialize the path(include the file name such as otherName.config).



i recently build a WCF solution, in Server project, i manipulate data by using ADO .NET Entity Framework. both WCF Host project and EF project needed their configuration files and the default name of these configuration files is app.config.

When we code, there is no need to manipulate the XML formatted app.config file, we just use following codes, ant the .NET application can automatically retrieve elements from app.config:


 // WCF Project
 using (var host=new ServiceHost(typeof(Server.Settings.Configration))) {
 Console.WriteLine("WCF has been started, press any key to end..");
// EF Project

How to upload files to remote machine using FTP or other method in VB.Net 2005 (Windows Application)



I have to create an application to upload and download files using FTP.
Are there any classes, methods in VB.Net 2005(Windows Application) to do this?

I have created a small GUI for this.

It contains 4 text boxes - Path of Local file to be uploaded, IP address of remote machine, User name and password of remote machine At last there is one Transfer button when I click on this transfer button that file should get copied to the remote machine.


I tried this using FTPWebRequest class by reading example in msdn.

But to connect to remote machine it requires URI format of FTP and I only have IP address of that remote machine. I think there is no web server on that remote machine.

Should I need to install web server on that remote machine.

Or is there any other method to do upload files to remote machine ?


Data Sources in Configuration Files



In an Integration Services project, I can see there's a section for Data Sources which is used for defining shared data sources for all the packages. In addition, each package can define connection managers of its own, and these managers can be configured using configuration files for the packages. My question is whether I can also use the configuration files to configure the shared data sources and how.



About Configuration files


Can we create one xml-configuration file for more than one package? and how?

can we create single configuration (any type sql,xml,registry..) for multiple packages..?..and how..?

Security Briefs: Web Application Configuration Security Revisited


Bryan Sullivan follows up on configuration security with some relatively obscure-but important-web.config settings that should be addressed, and discusses a new free tool to help you find potential problems.

Bryan Sullivan

MSDN Magazine November 2010

ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend