我如何重定向"bin"?和"obj"目录到其他位置? [英] How can I redirect the "bin" and "obj" directories to a different location?
问题描述
是否可以告诉Visual Studio为bin
和obj
目录使用不同的位置?
Is there a way to tell Visual Studio to use a different location for the bin
and obj
directories?
例如,如果我的项目在 C:\ my \ myprojects.csproj 中,那么如何在 D:\中拥有obj
和bin
目录? otherdirectory \ bin 和 D:\ otherdirectory \ obj . Visual Studio项目选项仅提供重定向bin
目录,而不重定向obj
目录.
For example, if my project is in C:\my\myprojects.csproj, how can I have the obj
and bin
directories in, say, D:\otherdirectory\bin and D:\otherdirectory\obj. The Visual Studio project option offer only to redirect the bin
directory, not the obj
directory.
还有一个额外的问题:我可以使用环境变量,而不是完整路径或相对路径吗?
Also, bonus question: Can I use environment variables, not full or relative paths?
这可能吗?
推荐答案
请参阅本文,并使用.proj文件中的节点 BaseOutputPath (用于bin
文件夹)和 BaseIntermediateOutputPath (用于obj
文件夹).
Refer to this article and use the nodes BaseOutputPath (for the bin
folder) and BaseIntermediateOutputPath (for the obj
folder) in the .proj file.
以下提供了一种相对于bin
-
Given below is a way to modify your debug and release folders relative to bin
-
在解决方案资源管理器中,选择要配置的C#项目 建立参数.
In Solution Explorer, select the C# project you want to configure build parameters on.
接下来,从Visual Studio菜单栏中,选择 Project → 属性.将为您的项目显示属性页"对话框.
Next, from the Visual Studio menu bar, select Project → Properties. The Property Pages dialog will appear for your project.
选择要更改的配置( Release / Debug ),然后在左侧窗格中展开配置属性"节点.选择Studio放置在 Outputs 的"Output path"属性中 属性表.
Choose the Configuration (Release/Debug) you want to change and expand the Configuration Properties node in the left hand pane. Select the Studio is placed in the "Output path" attribute of the Outputs property sheet.
请注意,每种类型的输出路径都是分别指定的 构建配置,并且将其设置为一种配置不会 将其设置在所有其余的上.
Be aware that the output path is specified separately for each kind of build configuration, and that setting it on one configuration doesn't set it on all the remaining ones.
原始来源- http: //www.eggheadcafe.com/software/aspnet/32040244/how-to-change-the-obj-folder.aspx
这篇关于我如何重定向"bin"?和"obj"目录到其他位置?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!