.NET different application settings for development and release

前端 未结 7 1062
慢半拍i
慢半拍i 2021-01-18 04:06

I am using VS2010 C#.NET 3.5 and application settings (the Settings.settings file). What I want to do is have different settings for my development and production environmen

7条回答
  •  孤城傲影
    2021-01-18 04:52

    If you use web deployment projects, you can set it up so that different parts of your web.config will be replaced. You can read more about them here: http://weblogs.asp.net/scottgu/archive/2005/11/06/429723.aspx.

    Another approach, that we actually take at my current job is to have multiple web.config files - 1 for each environment (e.g. web.config, web.config.production). Then when we build for deployment, we use msbuild to automatically swap web.config.production in as the web.config.

提交回复
热议问题