App.Config Transformation for projects which are not Web Projects in Visual Studio?

后端 未结 14 2527
走了就别回头了
走了就别回头了 2020-11-22 04:06

For Visual Studio 2010 Web based application we have Config Transformation features by which we can maintain multiple configuration files for different environments. But the

14条回答
  •  北海茫月
    2020-11-22 04:23

    Another solution I've found is NOT to use the transformations but just have a separate config file, e.g. app.Release.config. Then add this line to your csproj file.

      
        App.Release.config
      
    

    This will not only generate the right myprogram.exe.config file but if you're using Setup and Deployment Project in Visual Studio to generate MSI, it'll force the deployment project to use the correct config file when packaging.

提交回复
热议问题