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

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

问题描述

2013年在Visual Studio 2010中,默认情况下(例如,当我创建一个新的控制台应用程序),新的解决方案输出的可执行编译成解决方案名称/项目名称/斌/调试/ 。我希望他们能够输出到解决方案名称/调试/ ,同样对于所有其它构建配置,如释放。

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".

我可以通过手动进入每个项目的性质,打算到构建设置页,改变输出路径从斌\\调试 .. \\调试。我必须重复此为每个项目和每个生成配置。

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 \\程序文件(x86)\\微软的Visual Studio 11.0 \\ Common7 \\ IDE \\ ProjectTemplates 并相应地更新它们。

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天全站免登陆