MSdeploy:Web 转换文件和参数化相互排斥吗?
我创建了一个具有特定配置(应用程序设置、连接字符串、绑定)的转换文件“Web.Release.config”。在同一个项目中,我还创建了parameters.xml 文件,并添加了几个配置参数(应用程序设置、绑定)。 之后,我构建了部署包“mypackage.zip”。
我修改了 setparameters.xml 文件,目的是使用与转换文件“Web.Release.config”中指定的配置不同的配置来部署 mypackage.zip。但是,当我部署包时,msdeploy 会忽略参数化,即使我指定在部署期间使用 setparameter.xml 也是如此。
转换文件和参数化是互斥的吗?
I created a transformation file "Web.Release.config" with a specific configuration (appsetings,connectionstring, bindings). In the same project, I created the parameters.xml file as well, and added a couple of parameters of my configuration (app setings, bindings).
After this I built the deployment package "mypackage.zip."
I went and modified the setparameters.xml file with the intention of deploying mypackage.zip using a different configuration to the one specified in the transformation file "Web.Release.config". But when I deployed the package, msdeploy ignores the parameterization, even though I specify to use the setparameter.xml during deployment.
are transformation files and parameterization mutually exclusive?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我不确定我是否完全理解你的问题,但这是一个镜头。
在 Visual Studio 2010 中,Web.config 转换是根据用于发布/打包的生成配置执行的。因此,在您的示例中,您声明您创建了一个配置转换 Web.Release.config,然后您说“...旨在使用不同的配置部署 mypackage.zip...”。如果您想部署不同的配置(即不是发布),那么您的配置转换将不会启动。您将需要创建另一个与 web.release.config 内容相似(或相同)的 web.config 转换。
您能让我知道这是否有帮助吗?如果没有,您能提供更多详细信息吗?
I am not sure if I fully understand your question, but here is a shot.
In Visual Studio 2010 Web.config transformations are executed based on the build configuration that is being used to publish/package. So in your example you stated that you created a config transform, Web.Release.config, and then you said "...with the intention of deploying mypackage.zip using a different configuration...". If you want to deploy a different configuration (i.e. not Release) then your config transformation will not kick in. You will need to create another web.config transformation which has similar content (or the same) as web.release.config.
Can you let me know if that helps, if not can you provide more details?