The Microsoft.VisualStudioVersion.v*.Common.props is part of the build system structure.
For VS2015(VS version 14.0) It has a Microsoft.VisualStudioVersion.v14.Common.props file in path C:\Program Files (x86)\MSBuild\14.0. Its content:
<PropertyGroup>
<VisualStudioVersion>14.0</VisualStudioVersion>
<VSToolsPath>$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)
</VSToolsPath>
</PropertyGroup>
It defines current VS version 14.0.
For VS2017, it has a corresponding Microsoft.VisualStudioVersion.v15.Common.props file in path $(MSBuildExtensionsPath)\$(MSBuildToolsVersion) which defines current vs version 15.0.
But for VS2019, why it's still the Microsoft.VisualStudioVersion.v15.Common.props file in path $(MSBuildExtensionsPath)\$(MSBuildToolsVersion) which defines current vs version15.0, shouldn't it be Microsoft.VisualStudioVersion.v16.Common.props?
I know that in some cases we don't need to use it. But for C# projects, it will always call the Microsoft.Common.props file, and it has a statement: <Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.VisualStudioVersion.v*.Common.props" Condition="'$(VisualStudioVersion)' == ''" />, so if we don't define the VS version before this statement, now the VS version will be set to 15.0 though it's msbuild for VS2019.(16.0)
I suggest we can update this file. And if I misunderstand anything, please correct me!
Looks to me like we created the right file:
But did not update our setup authoring to install the new one:
I agree that this is wrong. @v-lali, are you interested in contributing a fix?
Sorry that I'm not that familiar with the contributing process in github, and it would be so great that you could help me about it. Thanks a lot for your help : )
Successful VS insertion:
https://dev.azure.com/devdiv/DevDiv/_git/VS/pullrequest/207287?_a=overview
Most helpful comment
Looks to me like we created the right file:
https://github.com/microsoft/msbuild/blob/cb1e0dfbca8b84d7565347d61a1ea47820c1787c/src/Tasks/Microsoft.VisualStudioVersion.v16.Common.props
But did not update our setup authoring to install the new one:
https://github.com/microsoft/msbuild/blob/cb1e0dfbca8b84d7565347d61a1ea47820c1787c/src/Package/MSBuild.VSSetup/files.swr#L12-L14
I agree that this is wrong. @v-lali, are you interested in contributing a fix?