SDK exe项目在构建时创建net472文件夹

问题描述 投票:0回答:1

我对解决方案进行了重大更改,主要是将项目转换为SDK样式的项目。 该解决方案包含具有各种固件的项目(.net4.0、.net 4.6.1、.net4.7.2、.net4.8)。 我的启动项目是一个 .net FW 4.7.2 控制台应用程序 (*.exe),也转换为 SDK 项目风格。 当我构建解决方案\启动项目时,exe 文件位于输出目录中新创建的文件夹中 - 名为 net472 (bin\debug 等472)。 net472 包含 exe 文件以及其他 dll,而“原始”输出目录中也有 dll (bin\debug)

csproj 中没有任何特殊属性 - 我编辑它以包含输出目录,但它没有影响。 可能是什么原因以及我应该做什么,才能在“原始”输出目录中找到 exe 以及其余 DLL?

c# .net msbuild dotnet-build
1个回答
0
投票

尝试在csproj中添加以下属性

<AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath>

参考:https://learn.microsoft.com/en-us/dotnet/core/project-sdk/msbuild-props#appendtargetframeworktooutputpath

也可以考虑设置

AppendRuntimeIdentifierToOutputPath=false

© www.soinside.com 2019 - 2024. All rights reserved.