如何在Visual Studio中更改默认构建输出目录? [英] How can I change the default build output directory in Visual Studio?

查看:812
本文介绍了如何在Visual Studio中更改默认构建输出目录?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在Visual Studio 2010到2013,默认情况下(例如,当我创建一个新的控制台应用程序)新解决方案输出他们编译的可执行文件到解决方案名称/项目名称/ bin / Debug / 。我希望它们输出到解决方案名称/ Debug / ,同样对于所有其他构建配置,如发布。

In Visual Studio 2010 through 2013, by default (eg. When I create a new Console Application) new solutions output their compiled executable into Solution name/Project name/bin/Debug/. I want them to be output into Solution name/Debug/, and likewise for all other build configurations like "Release".

我可以通过手动进入每个项目的属性,进入 Build 选项卡,更改输出路径 bin\Debug .. \Debug 。我必须对每个项目和每个构建配置重复此操作。

I can do this by manually going into properties of each project, going to the Build tab, changing Output path from bin\Debug to ..\Debug. I must repeat this for every project and every build configuration.

在几十个解决方案之后,我有点不舒服,每次手工完成这个乏味的任务。有没有办法改变默认输出路径?

After dozens of solutions, I'm a bit sick of doing this tedious task by hand every time. Is there a way to change the default output path?

一个适用于Visual Studio 2013的解决方案就足够了。

A solution that works for Visual Studio 2013 is sufficient.

推荐答案

此属性在每个 Visual Studio项目模板中定义

因此,例如,C#控制台应用程序模板位于

So, for example, the C# Console Application template is located in

\Program Files (x86)\Microsoft Visual Studio 11.0\Common7\IDE\ProjectTemplates\CSharp\Windows\1033\ConsoleApplication\consoleapplication.csproj

csproj是一个XML文件,您可以随意编辑。构建输出目录是这样定义的(对于每个配置):

The csproj is an XML file that you can edit at your will. The build output directory is define like this (for each configuration):

...
<OutputPath>bin\Debug\</OutputPath>
...
<OutputPath>bin\Release\</OutputPath>
...



如果更改此文件,它将更改所有未来的新C#控制台应用程序项目。您还可以编写一个实用程序,其中列出所有csproj在 \Program Files(x86)\Microsoft Visual Studio 11.0 \Common7\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\ Project \\因此。

If you change this file, it will change all your future new C# Console Application projects. You could also write a utility program that list all csproj in \Program Files (x86)\Microsoft Visual Studio 11.0\Common7\IDE\ProjectTemplates and update them accordingly.

这篇关于如何在Visual Studio中更改默认构建输出目录?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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