为什么在Visual Studio中有单独的Debug和Release文件夹? [英] Why have separate Debug and Release folders in Visual Studio?

查看:679
本文介绍了为什么在Visual Studio中有单独的Debug和Release文件夹?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

默认情况下,Visual Studio为Debug和Release构建创建单独的bin文件夹。我们正在从外部依赖关系的角度处理一些小问题,有时我们希望释放二进制文件并有时会调试。这将使生活稍微更容易在所有项目上只有一个bin文件夹,并使Debug和Release的目标。我们可以在一个位置指出我们的外部脚本等。

By default, of course, Visual Studio creates separate bin folders for Debug and Release builds. We are having some minor issues dealing with those from the perspective of external dependencies, where sometimes we want release binaries and sometimes debug. It would make life slightly easier to just have a single bin folder on all projects and make that the target for both Debug and Release. We could then point our external scripts, etc. at a single location.

同事质疑为什么我们不能这样做 - 更改VS项目设置去同一个bin文件夹?我承认,我无法真正想到一个很好的理由来保持他们,除了容易看到我的本地文件系统是Debug,哪些是Release。但是呢这是什么收获?

A co-worker questioned why we couldn't just do that--change the VS project settings to go to the same bin folder? I confess I couldn't really think of a good reason to keep them, other than easily being able to see on my local filesystem which are Debug and which are Release. But so what; what does that gain?

我的问题:


  • 您有不同的Debug和Release文件夹?您的开发过程中有哪些流程?

  • 如果您不能保留这种区别,可能会发生什么坏事?

  • 相反,如果你已经走了单一文件夹路由,这有什么帮助您吗?

我不是问为什么要单独调试和发布版本。我明白了每个人的不同之处。我的问题是将它们放在不同的文件夹中。

I am NOT asking why have separate Debug and Release builds. I understand the difference, and the place of each. My question concerns placing them in separate folders.

推荐答案

我看到的方式,这对开发者的机器来说只是一个方便他们同时编译并运行Debug和Release版本。

The way I see it, this is simply a convenience on the developer's machine allowing them to compile and run both Debug and Release builds simultaneously.

如果您在Visual Studio中运行脚本或工具,则IDE允许您使用ConfigurationName和其他宏获取与配置无关的路径。

If you have scripts or tools running inside Visual Studio, the IDE allows you to use the ConfigurationName and other macros to obtain paths which are configuration-independent.

如果您从命令行外部运行脚本和工具(即,您正在构建某种类型的发布或部署过程) ),最好在构建服务器上执行此操作,其中Debug和Release之间的区别消失。

If you are running scripts and tools externally from the command-line (i.e. you are structuring some kind of release or deployment process around it), it is better to do this on a build server, where the distinction between Debug and Release goes away.

例如,当您从命令行调用msbuild (在构建服务器上),您可以为Debug或Release指定配置属性,并将OutputPath属性仅指定为一个位置(不管配置如何)。

For example, when you invoke msbuild from the command-line (on the build server) you can specify the Configuration property for Debug or Release, and the OutputPath property to build to one location only (regardless of the Configuration).

这篇关于为什么在Visual Studio中有单独的Debug和Release文件夹?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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