13

While we build project it will automatically create App.Config file...

But in case when we are not using this .Config file, so is there any way to stop create App.Config file.

Sagar Upadhyay
  • 335
  • 1
  • 4
  • 13
  • Maybe related http://stackoverflow.com/questions/207566/prevent-visual-studio-from-automatically-creating-mixed-platforms-solution-con – Soner Gönül Aug 06 '13 at 09:45

3 Answers3

9

If the selected answer doesn't work for you, i.e. App.Config file still keeps getting created, then you likely have the Auto-generate binding redirects selected in your Project -> Properties.

enter image description here

In this case, you can uncheck and save this setting, and then remove the app.config file ans save the project.

This solves the problem.

Shiva
  • 20,575
  • 14
  • 82
  • 112
6

if you are not using it at all, just remove it from your project and it won't get created anymore.

Davide Piras
  • 43,984
  • 10
  • 98
  • 147
0

In my case I am creating a window service which has a name like "SomethingService", inside this, there is an "App.config" file. After compilation the output includes the following:

  1. App.config
  2. SomethingService.exe
  3. SomethingService.exe.config

"SomethingService.exe.config" is actually a copy from "App.config" therefore there is no use for "App.config". Based on How not to copy app.config:

settings

I have set these properties and the result is:

  • No additional "App.config"
  • "SomethingService.exe.config" which is a copy of "App.config"

just as expected.

DanielV
  • 2,076
  • 2
  • 40
  • 61