VS 2017新项目格式和外部道具文件

VS 2017 new project format and external props file

假设我有以下项目文件:

<Project>

  <Import Project="Sdk.props" Sdk="Microsoft.NET.Sdk" />

  <PropertyGroup>
    <TargetFramework>net47</TargetFramework>
  </PropertyGroup>

  <Import Project="Sdk.targets" Sdk="Microsoft.NET.Sdk" />

</Project>

是否可以将 TargetFramework 属性 移动到外部道具文件?当我尝试这样做时,Visual Studio 给我一个 "one-way upgrade" 错误。

您在 Visual Studio 解释 csproj 文件的方式中遇到了一个已知问题。在命令行(msbuild.exe 或 dotnet.exe)上,您可以使用来自导入文件的 属性 TargetFramework 构建项目。 Visual Studio,但是导入的时候不识别这个

https://github.com/dotnet/project-system/issues/1358