使用构建变量填充web.config [英] Populate web.config with build variables

查看:65
本文介绍了使用构建变量填充web.config的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在编辑构建时,我可以设置一些变量".可以使用这些变量来转换web.config吗?

解决方案

通常,基于构建配置对web.config进行转换,并将值存储在其转换文件中.因此,如果为配置创建变量(例如$(BuildConfiguration)),则可以将构建配置设置为此变量,并设置此变量的值以控制构建配置,并且web.config将基于该配置进行转换. /p>

如果要将变量的值传输到web.config文件中.您可以使用令牌化任务.该任务可以读取变量值并将其写入web.config.

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

解决方案

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.

这篇关于使用构建变量填充web.config的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆