New VS 2017 project format and external props file

Suppose I have the following project file:

<Project>

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

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

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

</Project>

Can I transfer the TargetFramework property to an external attribute file? When I try to do this, Visual Studio gives me a "one-way update" error.

+1
source share
1 answer

You have encountered a known issue in the way Visual Studio interprets csproj files. At the command line (msbuild.exe or dotnet.exe) you can create a project with the input of the property TargetFrameworkfrom the imported file. Visual Studio, however, does not recognize this upon import.

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

+2

Source: https://habr.com/ru/post/1017208/


All Articles