none
Is there way to change Web.config site/WCF to something else, say like Project.config? RRS feed

  • Question

  • Hi,

    I have solution with different Projects and their configs. Some are console and have app.config and some are sites/wcf and have web.configs. Most of the stuff are the same though. So instead of maintaining all the different config files and related environments like debug, release, etc. I though about creating one generic Config with transformations for respective environments. Put that config is some folder and have all respective project reference that config. I know how to override console projects to use other configs other than app.config but not so with site/WCF. Anybody have any idea of how to go about this?

    In short, have one config, say called project.config. I am using it for all projects with console/windows forms. Now I need to see the possibility of using it for website/wcf projects which have web.config as default. Anyway idea how to do that. if I change the name for web.config to something else, an empty web.config will be created when compiled.

    Thanks,

    Isse

    Friday, March 28, 2014 6:26 PM

Answers

  • You can put any machine-wide settings in the Machine.config file: http://msdn.microsoft.com/en-us/library/ms229697(v=vs.90).aspx

    The App.config/Web.config files for each application can then be used to override the settings of the Machine.config file and store settings which are limited to particular application.

    Saturday, March 29, 2014 2:55 PM
  • Thanks for the reply. I am looking more like a config that will work for all the projects in different solutions. It will have setting that they all need for different environments.  This will also help lessen maintenance. I was hoping to put it in common folder where projects can reference from it then.

    Currently pursuing a config that has a diff name other than web.config through MSBuild. But I am stuck on changing that filename before publishing so when we publish, we can have the web.config instead of say Project.config.


    Thanks, Isse

    Tuesday, April 1, 2014 10:23 PM

All replies

  • You can put any machine-wide settings in the Machine.config file: http://msdn.microsoft.com/en-us/library/ms229697(v=vs.90).aspx

    The App.config/Web.config files for each application can then be used to override the settings of the Machine.config file and store settings which are limited to particular application.

    Saturday, March 29, 2014 2:55 PM
  • Thanks for the reply. I am looking more like a config that will work for all the projects in different solutions. It will have setting that they all need for different environments.  This will also help lessen maintenance. I was hoping to put it in common folder where projects can reference from it then.

    Currently pursuing a config that has a diff name other than web.config through MSBuild. But I am stuck on changing that filename before publishing so when we publish, we can have the web.config instead of say Project.config.


    Thanks, Isse

    Tuesday, April 1, 2014 10:23 PM