Populate web.config with build variables

允我心安 提交于 2019-12-24 14:00:06

问题


Upon editing a build, I can set some 'variables'. Is it possible to have these variables be used to transform web.config?


回答1:


Usually, web.config is transformed base on the build configuration and the value is stored in their transformation files. So if you create a variable for configuration such as $(BuildConfiguration), you can set the build configuration to this variable and set the value of this variable to control the build configuration and the web.config will be transformed base on the configuration.

If you want to transfer the value of a variable into web.config file. You can use Tokenization task. This task could read the variable value and write it to web.config.



来源:https://stackoverflow.com/questions/35701401/populate-web-config-with-build-variables

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!