title: ToolsVersion in Visual Studio 2019
body: <p>I am doing the migration of several projects from VS2010 to VS2019. Those projects have Tools Version 4 in their vcxprojs:</p>
  
  <pre><code>&lt;Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"&gt;
  </code></pre>
  
  <p>Target VS is VS2019 v16.5.0, MSBuild version is 16.5.0.12403, so I am trying to set ToolsVersion to 16.5:</p>
  
  <pre><code>&lt;Project DefaultTargets="Build" ToolsVersion="16.5" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"&gt;
  </code></pre>
  
  <p>But it seems that MSBuild doesn't like it:</p>
  
  <pre><code>1&gt;Building with tools version "Current".
  1&gt;Project file contains ToolsVersion="16.5". This toolset may be unknown or missing, in which case you may be able to resolve this by installing the appropriate version of MSBuild, or the build may have been forced to a particular ToolsVersion for policy reasons. Treating the project as if it had ToolsVersion="Current".
  </code></pre>
  
  <p>Despite builds are anyway successful, I care about this message. What can be wrong here? </p>
  
  <p>UPD:<br>
  Providing simplified example of structure of projects:<br>
  common props:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"&gt;
  &lt;PropertyGroup&gt;
          &lt;ShouldUnsetParentConfigurationAndPlatform&gt;false&lt;/ShouldUnsetParentConfigurationAndPlatform&gt;
  &lt;/PropertyGroup&gt;
  &lt;PropertyGroup Label="Globals"&gt;
          &lt;WindowsTargetPlatformVersion&gt;10.0&lt;/WindowsTargetPlatformVersion&gt;
          &lt;DotNetFrameworkVersion&gt;v4.0&lt;/DotNetFrameworkVersion&gt;
  &lt;/PropertyGroup&gt;
  &lt;!-- Other common variables--&gt;
  &lt;/Project&gt;
  </code></pre>
  
  <p>cpp props:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"&gt;
      &lt;PropertyGroup Label="Configuration"&gt;
          &lt;ConfigurationType&gt;DynamicLibrary&lt;/ConfigurationType&gt;
      &lt;/PropertyGroup&gt;
  
      &lt;PropertyGroup&gt;
          &lt;TargetExt&gt;.dll&lt;/TargetExt&gt;
      &lt;/PropertyGroup&gt;
  
     &lt;PropertyGroup Label="Configuration"&gt;
          &lt;PlatformToolset&gt;v142&lt;/PlatformToolset&gt;
      &lt;/PropertyGroup&gt;
  
      &lt;Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" /&gt;
      &lt;Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" /&gt;
      &lt;Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /&gt;
      &lt;Import Project="common.props" /&gt;
  
      &lt;-- compiler, linker settings and so on --&gt;
  &lt;/Project&gt;
  </code></pre>
  
  <p>Real project:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;Project DefaultTargets="Build" ToolsVersion="16.5" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"&gt;
      &lt;PropertyGroup Label="Globals"&gt;
      &lt;ProjectName&gt;my_name&lt;/ProjectName&gt;
      &lt;ProjectGuid&gt;{my_guid}&lt;/ProjectGuid&gt;
      &lt;RootNamespace&gt;my_ns&lt;/RootNamespace&gt;
      &lt;Keyword&gt;my_keyword&lt;/Keyword&gt;
    &lt;/PropertyGroup&gt;
    &lt;Import Project="cpp.props" /&gt;
    &lt;-- configurations (Release, Debug, x64/Win32 and so on --&gt;
    &lt;-- project-specific compiler/linker settings --&gt;
    &lt;-- items: cpp, heanders and so on --&gt;
    &lt;-- references --&gt;
    &lt;Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" /&gt;
    &lt;ImportGroup Label="ExtensionTargets"&gt;
    &lt;/ImportGroup&gt;
  &lt;/Project&gt;
  </code></pre>