将构建配置链接到发布配置文件 [英] Link build configuration to a publish profile

查看:34
本文介绍了将构建配置链接到发布配置文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

为什么 Microsoft 不允许您将构建配置链接到发布配置文件.相反,它会告诉您使用主 VS 界面中的下拉菜单.

Why does Microsoft not allow you to link a build configuration to a publish profile. Instead it tells you to use the dropdown in the main VS interface.

我觉得这非常烦人,因为我们使用配置转换来根据我们发布到的环境(例如数据库连接字符串)更改我们的配置设置.我们还签入 .Publish.xml 文件,以便将发布路径保存在源代码管理中.如果有人忘记更改构建配置,他们可能会意外地将测试发布到生产中,反之亦然.如果我们可以使用发布配置文件检查构建配置选择,我们就不会遇到这个问题.

I find this extremely annoying, because we use config transforms to change our config settings based on the environment we are publishing to (such as database connection strings). We also check-in the .Publish.xml file, so that the publish paths are saved in source control. If someone forgets to change the build configuration they could accidentally publish test to production or vice versa. If we could check in the build configuration selection with the publish profile we would not have this issue.

有谁知道微软未来是否计划改变这一点?

Does anyone know if Microsoft plans on changing this in the future?

推荐答案

纯属运气,我发现了这个:

By pure luck, I found this:

http://blogs.msdn.com/b/webdev/archive/2012/06/15/visual-studio-2010-web-publish-updates.aspx

如果您安装此更新(与 Azure 相关),则发布工具将更新为向导类型界面,该界面确实将发布配置文件与特定构建配置相关联.

If you install this update (related to Azure), then the publishing tools are updated to a wizard type interface that DOES tie a publish profile to a specific build configuration.

我不太明白为什么这与 Azure 相关联,但它适用于所有类型的发布(我使用发布到文件夹选项).不再使用错误的构建配置进行发布!

I don't really understand why this is tied to Azure, but it works perfectly for all types of publishing (I use the publish to a folder option). No more publishing with the wrong build configuration!

这篇关于将构建配置链接到发布配置文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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