c# - 如何在 Visual Studio 2017 项目(新的 .csproj 文件格式)中设置 `OutputPath` 而目标框架不会混淆已解析的路径?

标签 c# msbuild visual-studio-2017

在新的 Visual Studio 2017 项目格式中设置 OutputPath 会自动在路径中添加目标框架。例如,如果我在项目文件中设置了这些:

<TargetFramework>net462</TargetFramework>
<OutputPath>/build/debug/<OutputPath>

实际的输出文件夹将解析为 /build/debug/net462/,而不是旧版本中的 /build/debug/。 如果没有变通办法(例如通过构建后操作移动事物),我该如何解决这个问题?

最佳答案

解决方案是使用AppendTargetFrameworkToOutputPath https://www.tabsoverspaces.com/233608-stopping-msbuild-appending-targetframework-to-outputpath/

<AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath>

关于c# - 如何在 Visual Studio 2017 项目(新的 .csproj 文件格式)中设置 `OutputPath` 而目标框架不会混淆已解析的路径?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43602782/

相关文章:

c# - 使用单一服务在 Linux 上测试 Windows DOTNET 服务

c# - 在没有管理员权限的情况下安装 MSBuild 15(Microsoft Build 工具)?

msbuild - AfterTargets 失败不会导致 msbuild run 失败

c# - Visual Studio 复制设置为 "Do not copy"的 dll 文件

msbuild - msbuild/t :Pack supported in full . 是网络框架吗?

visual-c++ - boost 1.66.0 msvc-14.1 错误

c++ - QtCreator qmake 无法运行编译器 'cl'

c# - 在 C#6.0 中编码但针对 .NET 2.0 进行编译的缺点

c# - 带有 nhibernate 的 c# 控制台应用程序中的 Hilo

c# - ILookup<TKey, TVal> 与 IGrouping<TKey, TVal>