Fix errors in MSBuild prperties initialization in System.Private.CoreLib.csproj ...
authorJacek Blaszczynski <biosciencenow@outlook.com>
Wed, 19 Jul 2017 15:36:41 +0000 (17:36 +0200)
committerJan Kotas <jkotas@microsoft.com>
Wed, 19 Jul 2017 15:36:41 +0000 (17:36 +0200)
commit96997df404bbf1b30969aeed6303bc1fead43ed7
tree43420c7de8c05069bdac0e7995489da62a7d73d6
parenta14608efbad1bcb4e9d36a418e1e5ac267c083fb
Fix errors in MSBuild prperties initialization in System.Private.CoreLib.csproj (#12356)

Fixes issue #12355

Project System.Private.CoreLib.csproj imports directly Microsoft.Net.Compilers.props
at line# 4 before including dir.props from repo root. $(RepoRoot)/dir.props imports
Microsoft.Net.Compilers.props at line# 186. As a result of this sequence of duplicated
project imports and lack of safeguards against importing the same .props file twice
MSBuild reports that Microsoft.Net.Compilers.props file is included twice with warning
that second import will be ignored - in this case not evaluated. This results
in initialization of Microsoft.Net.Compilers.props values to defaults because MSBuild
evaluates Microsoft.Net.Compilers.props only once before $(RepoRoot)/dir.props are included.
Removing import of Microsoft.Net.Compilers.props from System.Private.CoreLib.csproj
and moving $(RepoRoot)/dir.props file import to top of System.Private.CoreLib.csproj
solves these problems by ensuring expected order of evaluation of Microsoft.Net.Compilers.props
file by MSBuild after all project wide values are initialized in $(RepoRoot)/dir.props.
dir.props
src/mscorlib/System.Private.CoreLib.csproj