gpt4 book ai didi

c# - 如何在C#中配置中间输出目录

转载 作者:IT王子 更新时间:2023-10-29 04:08:07 25 4
gpt4 key购买 nike

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

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

在 .csproj 文件中。中间对象现在在构建解决方案时放在该位置,但问题是 obj打开解决方案时,仍会在 .csproj 文件所在的目录中创建目录(效果为 obj\Debug\TempPE )。这个目录有什么用,我该如何重新定位它?

最佳答案

您可以尝试这样做(不要忘记有调试和发布部分将根据您的目标构建类型使用):

<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# - 如何在C#中配置中间输出目录,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3311212/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com