How do I set `OutputPath` in a Visual Studio 2017 project (new .csproj file format) without the target framework cluttering the resolved path?(如何在 Visual Studio 2017 项目(新的 .csproj 文件格式)中设置“OutputPath,而目标框架不会弄乱解析的路径?)
问题描述
在新的 Visual Studio 2017 项目格式中设置 OutputPath
会自动在路径中添加目标框架.例如,如果我在项目文件中设置了这些:
Setting OutputPath
in the new Visual Studio 2017 project format automatically adds the target framework in the path. For example, if I have these set in the project file:
<TargetFramework>net462</TargetFramework>
<OutputPath>/build/debug/<OutputPath>
实际的输出文件夹将解析为 /build/debug/net462/
,而不是像旧版本中的 /build/debug/
.如果没有使用构建后操作移动东西等变通方法,我该如何解决这个问题?
The actual output folder will resolve to /build/debug/net462/
, not /build/debug/
like in the older versions.
How do I solve this without workarounds like moving things around with post build actions?
推荐答案
解决方案是使用 AppendTargetFrameworkToOutputPath
https://www.tabsoverspaces.com/233608-stopping-msbuild-appending-targetframework-to-outputpath/
<AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath>
这篇关于如何在 Visual Studio 2017 项目(新的 .csproj 文件格式)中设置“OutputPath",而目标框架不会弄乱解析的路径?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:如何在 Visual Studio 2017 项目(新的 .csproj 文件格式


基础教程推荐
- JSON.NET 中基于属性的类型解析 2022-01-01
- 从 VS 2017 .NET Core 项目的发布目录中排除文件 2022-01-01
- 在 VS2010 中的 Post Build 事件中将 bin 文件复制到物 2022-01-01
- 如何动态获取文本框中datagridview列的总和 2022-01-01
- 错误“此流不支持搜索操作"在 C# 中 2022-01-01
- 将事件 TextChanged 分配给表单中的所有文本框 2022-01-01
- 经典 Asp 中的 ResolveUrl/Url.Content 等效项 2022-01-01
- 首先创建代码,多对多,关联表中的附加字段 2022-01-01
- 全局 ASAX - 获取服务器名称 2022-01-01
- 是否可以在 asp classic 和 asp.net 之间共享会话状态 2022-01-01