根据所选的发布配置文件,通过一键发布进行调试/发布构建配置

发布于 2024-11-02 14:30:30 字数 799 浏览 8 评论 0原文

这几乎与将构建配置链接到发布配置文件重复,但这个问题没有得到解答...


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

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

如果我选择 Build => 配置管理器 => 发布,然后单击“发布”按钮,我的应用程序将使用发布配置进行发布(反之亦然) - 无论当前选择的发布配置文件如何。

但我真正想要的是...

从“一键发布”设置中设置适当的构建配置。 测试服务器 应使用我的调试设置发布,生产服务器 应使用发布设置发布。

我不必在配置管理器中进行更改。但我愿意。

所以,我有两个问题:

我做错了吗?根据发布设置中的一条小注释,指出“使用构建配置管理器更改配置”,这似乎正是它的工作方式。

booya

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


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

This is almost a duplicate of Link build configuration to a publish profile, but that question was not answered...


I have 2 1 Click Publish configurations for my Web Application:

  1. Test Server
  2. Production Server

If I select Build => Configuration Manager => Release and then click the Publish button my application will be published with a release configuration (and visa versa) - without regard to the current Publish profile selected.

But what I REALLY want is...

To set the appropriate Build Configuration from the 1 Click Publish settings. Test Server should be published with my Debug settings and Production Server should be published with the Release settings.

I shouldn't have to make the change from within the Configuration Manager. But I Do.

So, I have 2 questions:

Am I just doing it wrong? Based on a little note in the Publish Settings stating "Use Build Configuration Manager to change configuration" this seems like this is exactly how it is intended to work.

booya

Is there another way of having 2 publish profiles, one with a Debug config and one with a Release config?


The only thing I'm using the debug/release build configurations for is for my Config Transforms that have different connection strings. So, alternative, but still 1 Click, publishing solutions are acceptable. :-)

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

习ぎ惯性依靠 2024-11-09 14:30:30

可以通过使用多个 Web 部署包来实现另一种方式。

基本上创建两个不同的项目,每个项目都会编译并设置 asp.net 构建配置和输出。然后将部署脚本作为其中的一部分。

有点 hacky(希望发布配置文件可以按照您的意愿设置构建配置)。

除此之外,我通常通过 powershell 脚本进行操作,并从桌面部署开始,执行所有适当的编译和部署场景。

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

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

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/

神经暖 2024-11-09 14:30:30

我可以通过安装 Visual Studio Web 发布更新来使其正常工作。此更新允许您将构建配置绑定到特定的发布配置文件。

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

发布资料

I was able to get this to work by installing the Visual Studio Web Publish Update. This update allows you to tie a build configuration to a specific publish profile.

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

Publish Profile

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文