Msbuild: Update the Microsoft.VisualStudioVersion.v15.Common.props file in Folder structure of VS2019(16.0)

Created on 13 Sep 2019  路  3Comments  路  Source: dotnet/msbuild

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!

bug

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?

All 3 comments

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?

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 : )

Was this page helpful?
0 / 5 - 0 ratings

Related issues

justintoth picture justintoth  路  3Comments

cdmihai picture cdmihai  路  4Comments

rainersigwald picture rainersigwald  路  3Comments

ctolkien picture ctolkien  路  4Comments

jaredpar picture jaredpar  路  4Comments