总是发布带有发布代码的网站?
是否可以更改某些设置,以便 Visual Studio 在发布时始终使用“发布”配置?
我在开发时使用调试模式来清除一些缓存和类似的东西,并且我还有不同的 web.configs 用于发布和调试。有时,当我发布时,我忘记更改要发布的配置,最终导致网站损坏;)
我知道我可以使用 MS Build 或其他东西来做到这一点,但除此之外,发布工作正常。有什么建议吗?
Is it possible to change some setting so that Visual Studio always use the "release" configuration when publishing?
I use debug mode when i develop to clear some caches and stuff like that and i also have different web.configs for release and debug. Sometimes when i publish i forget to change the configuration to release and i end up with a broken website ;)
I understand i can do this with MS Build or something but publish working fine except for this. Any tips?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
提供的步骤:
http://msdn.microsoft.com/en-us/library/wx0123s5.aspx
Steps provided by:
http://msdn.microsoft.com/en-us/library/wx0123s5.aspx
至少从 VS 2017 开始,Web 发布设置现在包含要发布的配置的设置,默认为发布,因此即使 VS 仍处于调试配置,您也可以发布发布版本。
我只是希望他们也为常规的 Click-Once 应用程序执行此操作......
As of at least VS 2017, the web publish settings now include a setting for which configuration to publish, which defaults to Release, so you can publish the release build even when VS is still in Debug configuration.
I just wish that they had also done this for regular Click-Once applications as well...