25

这几乎是Link build configuration to a publish profile的副本,但这个问题没有得到回答......


我的 Web 应用程序有 2 1 单击发布配置:

  1. 测试服务器
  2. 生产服务器

如果我选择Build=> Configuration Manager=>Release然后单击发布按钮,我的应用程序将使用发布配置发布(反之亦然) - 不考虑当前选择的发布配置文件。

但我真正想要的是……

从 1 单击发布设置中设置适当的构建配置。Test Server应该与我的调试设置一起发布,并且Production Server应该与发布设置一起发布。

我不应该从配置管理器中进行更改。但是我愿意。

所以,我有两个问题:

我只是做错了吗?基于发布设置中的一个小注释,说明“使用构建配置管理器更改配置”,这似乎正是它的预期工作方式。

布亚

是否有另一种方法可以拥有 2 个发布配置文件,一个带有调试配置,一个带有发布配置?


我使用调试/发布构建配置的唯一目的是用于具有不同连接字符串的配置转换。因此,替代但仍然是 1 单击发布解决方案是可以接受的。 :-)

4

2 回答 2

2

It's possible to do another way by having multiple Web Deployment Packages.

Basically create two different projects and each one will compile and set the asp.net build config and output. Then script the deployment as part of it.

Bit hacky (wish the publish profiles could set the build config as you wished).

Other than that I normally do via powershell scripts and kick off from my desktop deploy that does all the appropriate compiling and deployment scenarios.

http://msdn.microsoft.com/en-us/magazine/cc163448.aspx

http://johnnycoder.com/blog/2010/01/07/deploy-aspnet-web-applications-with-web-deployment-projects/

于 2011-09-08T22:02:18.073 回答
1

我可以通过安装 Visual Studio Web Publish Update 来实现这一点。此更新允许您将构建配置绑定到特定的发布配置文件。

http://msdn.microsoft.com/en-us/library/jj161045.aspx

发布个人资料

于 2013-02-05T22:25:50.580 回答