如何配置中间输出目录在C#中? [英] How to configure Intermediate Output Directory in C#?

查看:321
本文介绍了如何配置中间输出目录在C#中?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想整理我的工作区,并希望可以把我的中间对象在 .. \build\obj 文件夹就我的.csproj文件。所以我把:

I'm trying to organize my workspace, and want my intermediate objects to be put in the ..\build\obj folder in relation to my .csproj file. So I put:

< IntermediateOutputPath> .. \build\obj\Debug< / IntermediateOutputPath>

在.csproj的文件。现在的中间对象被放置在该位置时,解决方案构建,但问题是,一个OBJ目录在目录中的.csproj文件是(某事 obj\的效果仍然产生Debug\TempPE )当溶液被打开。这是什么目录,以及如何才能重新定位呢?

in the .csproj file. The intermediate objects are now put in that location when the solution is built, but the problem is that an obj directory is still created in the directory the .csproj file is in (something to the effect of obj\Debug\TempPE) when the solution is opened. What is this directory for, and how can a relocate it?

推荐答案

您可以尝试做到这一点(不要忘了,有在调试和发布部分,这将取决于使用何种类型的构建你的目标)的:

You could try do this (don't forget that there are Debug and Release section which will be used depending on what type of build you are targeting):

<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
    ...
    <BaseIntermediateOutputPath>..\build\obj</BaseIntermediateOutputPath>
    <IntermediateOutputPath>$(BaseIntermediateOutputPath)$(Configuration)\</IntermediateOutputPath>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
    ...
    <BaseIntermediateOutputPath>..\build\obj</BaseIntermediateOutputPath>
    <IntermediateOutputPath>$(BaseIntermediateOutputPath)$(Configuration)\</IntermediateOutputPath>
</PropertyGroup>

这篇关于如何配置中间输出目录在C#中?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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