App.Config stops creating

While we are building the project, it will automatically create the App.Config file ...

But in case we do not use this .Config file, is there any way to stop the creation of the App.Config file.

+7
source share
3 answers

if you don’t use it at all, just delete it from your project and it will no longer be created.

+6
source

If the selected answer does not work for you, i.e. App.Config The App.Config file is still being created, then most likely, in your Project β†’ Properties, the App.Config binding redirection is App.Config .

enter image description here

In this case, you can remove and save this parameter, and then delete the app.config file and save the project.

This solves the problem.

+2
source

In my case, I create a window service with a name, for example, "SomethingService", inside which is located the file "App.config". 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", so for "App.config" it makes no sense. Based on How not to copy app.config :

settings

I set these properties, and the result is:

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

as expected.

0
source

Source: https://habr.com/ru/post/1495495/


All Articles