Copy app.config to deploy

If I have projects that are deployed by copying files (executables, dll and data files) to their destination folder, can I bypass copying the app.config ( executableName.config) file correctly , because it will be created anyway the first time the application is launched for a user in a local user repository?

Or otherwise requested, correctly, that the app.config ( executableName.config) in exeutables catalog /bin/debugor /bin/releaseintended only for debugging purposes, and can be removed without any consequences?

I have tested and used this without problems so far (deleting and not deploying the configuration file), but maybe there are some side effects that are not obvious at first glance?

+3
source share
3 answers

My understanding from this article is the [AppName] .exe.config file, which will be combined with other configuration files (for example, Machine.config, User.config) when the code is requested by the configuration.

Thus, if you do not have any configuration and you want to refuse the exe configuration, you should not have problems.

The exe configuration is not used for debugging purposes.

+1
source

The pdb files are for debugging, not for the configuration file. Configuration files are for configuration. Since you already create it for each user at startup, you can delete it.

app.config . . , app.config , .

+1

, .config . - application deployment framework, .config, , , . , :

web.config
web.development.config
web.testing.config
web.production.config

web.config , , , ...

web.config

  <connectionStrings>
    <clear />
    <add name="MyConnectionString" connectionString="<Dev connection string>" providerName="System.Data.SqlClient" />
  </connectionStrings>

web.production.config

  <connectionStrings>
    <add name="MyConnectionString"
      connectionString="<Production connection string>"
      xdt:Transform="SetAttributes" xdt:Locator="Match(name)"/>
  </connectionStrings>

, , .

google AppDeploy

Hope this helps?

+1
source

All Articles