From 96997df404bbf1b30969aeed6303bc1fead43ed7 Mon Sep 17 00:00:00 2001 From: Jacek Blaszczynski Date: Wed, 19 Jul 2017 17:36:41 +0200 Subject: [PATCH] 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 | 3 ++- src/mscorlib/System.Private.CoreLib.csproj | 8 +++----- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/dir.props b/dir.props index bdba8141da72..5f2f987bdf83 100644 --- a/dir.props +++ b/dir.props @@ -1,6 +1,7 @@ - + + diff --git a/src/mscorlib/System.Private.CoreLib.csproj b/src/mscorlib/System.Private.CoreLib.csproj index 6f32dfc659d2..0889a4b85488 100644 --- a/src/mscorlib/System.Private.CoreLib.csproj +++ b/src/mscorlib/System.Private.CoreLib.csproj @@ -1,10 +1,8 @@  - - - + + + - - amd64,x86,arm,armel,arm64