如何在C#中配置中间输出目录 [英] How to configure the intermediate output directory in C#

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

问题描述

我正在尝试组织我的工作区,并希望将我的中间对象放入与.csproj文件相关的 .. \ build \ obj 文件夹中.所以我说:

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 目录(这与 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 I relocate it?

推荐答案

您可以尝试执行此操作(不要忘记,将使用Debug和Release部分,具体取决于您要定位的构建类型):

You could try to do this (don't forget that there are Debug and Release sections 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天全站免登陆