问题描述
ASP.NET 4.5中的新pubxml文件绝对是朝正确方向迈出的一步.我也喜欢msdeploy
对parameters.xml
文件的支持(即使它们有时不如我想要的强大).现在,如何结合msdeploy
的参数和pubxml文件?我希望pubxml文件将允许我提供
The new pubxml files in ASP.NET 4.5 are definitely a step in the right direction.I also like msdeploy
's support for parameters.xml
files (even though they are sometimes not as powerful as I would like). Now, how do I combine msdeploy
's parameters and the pubxml files?I would expect that the pubxml files would allow me to provide a setting like
<ParametersFile>productionParameters.xml</ParametersFile>
或我的production.pubxml
文件中的类似内容,其中包含在发布到生产环境时要合并到web.config
中的值.可能吗,还是我必须回到自己的方式来确定参数文件并使用-setParamFile ="productionParameters.xml"调用msdeploy
?
or something similar in my production.pubxml
file, that would contain values to be merged into web.config
when publishing to the production environment. Is that possible or do I have to go back to rolling my own way of determining the parameters file and invoking msdeploy
with -setParamFile="productionParameters.xml"?
推荐答案
您不能设置自己的参数文件,但可以在pubxml
中声明参数值:
You can't set your own parameters file, but you can declare parameter values from within the pubxml
:
<ItemGroup>
<MSDeployParameterValue Include="Parameter Name">
<ParameterValue>Parameter Value</ParameterValue>
</MSDeployParameterValue>
</ItemGroup>
这篇关于使用ASP.NET 4.5发布配置文件时,如何参数化部署?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!