如何在Visual Studio 2017项目(新的.csproj文件格式)中设置“ outputpath”,而无需目标



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

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

实际输出文件夹将解析为/build/debug/net462/,而不是旧版本中的/build/debug/。我该如何解决这个问题,而没有解决方法,例如通过邮政构建动作移动事情?

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

<AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath>

上面的答案是正确的,但是您可能还需要删除运行时标识符:

<AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath>
<AppendRuntimeIdentifierToOutputPath>false</AppendRuntimeIdentifierToOutputPath>

最新更新