Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

C# why App.config is copied to my debug and release folder after build?

Tags:

c#

.net

I am using Visual Studio 2008 professional, C#. I found the App.config file is copied into the bin\debug and bin\release folder. Is that by default? I thought the XXX.exe.config file will be the only configuration file for a project.

  1. Is it safe to release our applicaion without the App.config?
  2. if yes, how to ask VS2008 to stop copy that file after build?

thanks

like image 841
5YrsLaterDBA Avatar asked May 27 '10 13:05

5YrsLaterDBA


1 Answers

Since .Net will be looking for a config file named after your executable, it is safe to release the application without "App.Config".

To stop VS copying the config file into your bin directory, select App.config in the solution explorer, show the Properties for the file, then change the "Copy to Output Directory" option to "Do not copy".

like image 157
Samuel Jack Avatar answered Sep 19 '22 11:09

Samuel Jack