5YrsLaterDBA
5YrsLaterDBA

Reputation: 34730

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

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

Upvotes: 7

Views: 7983

Answers (1)

Samuel Jack
Samuel Jack

Reputation: 33260

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".

Upvotes: 9

Related Questions