gpt4 book ai didi

visual-studio - OutputPath 设置为 bin\x86\release,但在使用 MSBuild 时显示为 obj\x86\release

转载 作者:行者123 更新时间:2023-12-04 14:48:28 24 4
gpt4 key购买 nike

在我的 .csproj 文件(C# 项目文件)中 OutputPath设置如下:

<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' ">
<DefineTrace>true</DefineTrace>
<OutputPath>bin\x86\Release\</OutputPath>
....
</PropertyGroup>

在我的 NAnt 脚本中,我有这个:

<msbuild project="${demo.solution}">
<property name="Configuration" value="release"/>

<property name="OutputPath" value="${output.dir}"/>
<property name="Platform" value="x86"/>
</msbuild>

为什么日志显示 DemoProject.dll 是从 obj\x86\release 复制的?

....

[msbuild] Project "Demo.sln" (1) is building "DemoProjec1.vbproj" (3) on node 0 (default targets).

[msbuild] Copying file from "obj\x86\Release\DemoProjec1.dll" to ${output.dir}\DemoProjec1.dll".

[msbuild] DemoProjec1 -> ${output.dir}\DemoProjec1.dll

[msbuild] Done Building Project "DemoProjec1.vbproj" (default targets).

....

bin 中的 DemoProject.dll 相比,obj 中的 DemoProject.dll 在大小上有所不同。

最佳答案

obj\x86\releaseIntermediateOutputPath用于发布配置。

您的项目在中间目录中编译,然后将结果文件复制到您的输出目录。在您的 NAnt 文件中,您将 OutputPath 覆盖为 ${output.dir},因此您的文件从 obj\x86\release 复制到 ${output.dir}.

关于visual-studio - OutputPath 设置为 bin\x86\release,但在使用 MSBuild 时显示为 obj\x86\release,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3581901/

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