Visual Studio 2019 为 .tlog 和 .dll.recipe 文件设置输出目录

Visual Studio 2019 set output directory for .tlog and .dll.recipe file

我在 Visual Studio 中有一个项目,并希望在 build\ 子目录下生成构建期间的所有文件。

我设置了我能找到的所有输出选项,但仍然有一个 Debug\ 文件夹,其中包含以下文件:projectname.dll.recipe 和子文件夹 projectname.xxxx.tlog,其中包含 .tlog.lastbuildstate 个文件。

我知道 .tlog 文件来自 MSBuild 文件跟踪器,知道 .dll.recipe 是什么。

如何将这些文件的输出目录设置为 $(OutDir)

您可以尝试以下步骤:

函数 1

在 VS 中打开您的项目 IDE 然后 right-click 在项目 Properties-->Configuration Properties-->常规--> 将中间目录更改为..$(Configuration).

然后,重建你的项目以获得你想要的。

函数 2

1) 在您的解决方案文件夹中添加一个名为 Directory.Build.props 的文件,如下所示:

2)Directory.Build.props中添加这些内容:

<Project>

<PropertyGroup>
<IntDir>..$(Configuration)\</IntDir>
</PropertyGroup>

</Project>

3) 关闭 VS 实例,删除解决方案文件夹中的任何 Debug 文件夹。

然后重启VS(启用Directory.Build.props的功能)打开你的解决方案重新构建,文件将在$(OutDir)路径下。