From 922982f29a0ce987888534df8afa9b8b024b9e28 Mon Sep 17 00:00:00 2001 From: Vatsan Madhavan Date: Mon, 15 Apr 2019 14:47:12 -0700 Subject: [PATCH 1/3] References will be delivered in .NET Core 3 through ref-packs instead of using PackageReference. This change adapts to that expectation. If we are still using an older version of tools.dotnet in global.json, we will go through `ResolveMicrosoftNetCoreAppReferences` . OTOH, when global.json gets updated to a newer version of tools.dotnet, `LimitNetCoreAppReferences` will kick-in and do the right thing. Adjust System.Xaml.csproj a bit to ensure that it has the right references. No other changes were necessary to projects in dotnet-wpf-int. Similar paths exist for `Microsoft.WindowsDesktop.App[.Ref]` - this is reserved for future use. --- eng/WpfArcadeSdk/tools/SdkReferences.targets | 173 ++++++++++++------ .../src/System.Xaml/System.Xaml.csproj | 23 ++- 2 files changed, 127 insertions(+), 69 deletions(-) diff --git a/eng/WpfArcadeSdk/tools/SdkReferences.targets b/eng/WpfArcadeSdk/tools/SdkReferences.targets index 6544fe441ce..0481c0d8990 100644 --- a/eng/WpfArcadeSdk/tools/SdkReferences.targets +++ b/eng/WpfArcadeSdk/tools/SdkReferences.targets @@ -5,97 +5,150 @@ ExcludeAssets="All" GeneratePathProperty="True" Condition="'$(MSBuildProjectExtension)'!='.vcxproj' And $(TargetFramework.StartsWith('netcoreapp3')) And '$(NoAutoMicrosoftPrivateWinformsReference)'!='true'"/> + + + + + - + + + + + + + + + + ResolveMicrosoftNetCoreAppReferences; + ResolveMicrosoftWindowsDesktopAppReferences; + ResolveMicrosoftDotNetWpfGitHubReferences; + ResolveWinFormsReferences; + $(ResolveAssemblyReferencesDependsOn) + + + + + + + + + + + - - - - + <_netCoreAppSdkReference Remove="@(_netCoreAppSdkReference)" /> - <_netCoreAppSdkReference Include="@(ReferencePath)" Condition="'%(ReferencePath.NuGetPackageId)'=='Microsoft.NETCore.App'"/> - + <_netCoreAppSdkReference Include="@(ReferencePath)" + Condition="'%(ReferencePath.NuGetPackageId)'=='Microsoft.NETCore.App.Ref'" /> + - - + - <_netCoreAppSdkUnwantedRefNormalized Remove="@(_netCoreAppSdkUnwantedRefNormalized)" /> - <_netCoreAppSdkUnwantedRefNormalized Include="@(_netCoreAppSdkReference->'%(FileName)')" /> - <_netCoreAppSdkUnwantedRefNormalized Remove="@(NetCoreReference)" /> + <_netCoreAppReferences Remove="@(_netCoreAppReferences)" /> + + + - - <_netCoreAppSdkUnwantedRef Remove="@(_netCoreAppSdkUnwantedRef)" /> - <_netCoreAppSdkUnwantedRef Include="@(_netCoreAppSdkUnwantedRefNormalized->'%(OriginalItemSpec)')" /> + - - + + + + - + - - - - + <_windowsDesktopAppSdkReference Remove="@(_windowsDesktopAppSdkReference)" /> - <_windowsDesktopAppSdkReference Include="@(ReferencePath)" Condition="'%(ReferencePath.NuGetPackageId)'=='Microsoft.WindowsDesktop.App'"/> + <_windowsDesktopAppSdkReference Include="@(ReferencePath)" + Condition="'%(ReferencePath.NuGetPackageId)'=='Microsoft.WindowsDesktop.App.Ref'" /> - - <_windowsDesktopAppSdkUnwantedRefNormalized Remove="@(_windowsDesktopAppSdkUnwantedRefNormalized)" /> - <_windowsDesktopAppSdkUnwantedRefNormalized Include="@(_windowsDesktopAppSdkReference->'%(FileName)')" /> - <_windowsDesktopAppSdkUnwantedRefNormalized Remove="@(WindowsDesktopReference)" /> + <_windowsDesktopAppReferences Remove="@(_windowsDesktopAppReferences)" /> + + + - - <_windowsDesktopAppSdkUnwantedRef Remove="@(_windowsDesktopAppSdkUnwantedRef)" /> - <_windowsDesktopAppSdkUnwantedRef Include="@(_windowsDesktopAppSdkUnwantedRefNormalized->'%(OriginalItemSpec)')" /> - - - - - + - - - - ResolveMicrosoftDotNetWpfGitHubReferences; - ResolveWinFormsReferences; - $(ResolveAssemblyReferencesDependsOn) - - - - It will get translated into something like this: + It will get translated into something like this: - --> + --> - @@ -128,11 +181,11 @@ - --> + --> - diff --git a/src/Microsoft.DotNet.Wpf/src/System.Xaml/System.Xaml.csproj b/src/Microsoft.DotNet.Wpf/src/System.Xaml/System.Xaml.csproj index 005d499df11..5e58bd4ebb1 100644 --- a/src/Microsoft.DotNet.Wpf/src/System.Xaml/System.Xaml.csproj +++ b/src/Microsoft.DotNet.Wpf/src/System.Xaml/System.Xaml.csproj @@ -51,13 +51,13 @@ Common\WPF\MS\Utility\FrugalList.cs - + - Common\System\SR.cs + Common\System\SR.cs - + @@ -83,32 +83,37 @@ - - - + + + - + + + - + - + + + + From 510ead58e98fa3a5787c1c709c6868197af5f87f Mon Sep 17 00:00:00 2001 From: Vatsan Madhavan Date: Mon, 15 Apr 2019 15:36:33 -0700 Subject: [PATCH 2/3] Update global.json tools.dotnet and sdk.version to be identical to the version in use today in release/3.0 branch. Remove redundant PackageReference from RuntimeFrameworkReference.props. opt-out tests from RuntimeFrameworkReference for now. --- .../tools/RuntimeFrameworkReference.props | 8 -------- .../tools/RuntimeFrameworkReference.targets | 18 +++++++++++++++--- global.json | 4 ++-- 3 files changed, 17 insertions(+), 13 deletions(-) diff --git a/eng/WpfArcadeSdk/tools/RuntimeFrameworkReference.props b/eng/WpfArcadeSdk/tools/RuntimeFrameworkReference.props index dff7f276903..8f7eb9ccecb 100644 --- a/eng/WpfArcadeSdk/tools/RuntimeFrameworkReference.props +++ b/eng/WpfArcadeSdk/tools/RuntimeFrameworkReference.props @@ -3,14 +3,6 @@ $(MicrosoftNETCoreAppVersion) - - - - - true diff --git a/eng/WpfArcadeSdk/tools/RuntimeFrameworkReference.targets b/eng/WpfArcadeSdk/tools/RuntimeFrameworkReference.targets index c9c4d59b569..a04e0e9783a 100644 --- a/eng/WpfArcadeSdk/tools/RuntimeFrameworkReference.targets +++ b/eng/WpfArcadeSdk/tools/RuntimeFrameworkReference.targets @@ -4,12 +4,24 @@ usually lags behind the version that WPF gets from CoreFx packages --> - - + + - + + diff --git a/global.json b/global.json index ee36759005f..7f1153fd59a 100644 --- a/global.json +++ b/global.json @@ -1,12 +1,12 @@ { "tools": { - "dotnet": "3.0.100-preview-010024", + "dotnet": "3.0.100-preview4-011144", "vs": { "version": "16.0" } }, "sdk": { - "version": "3.0.100-preview-010024" + "version": "3.0.100-preview4-011144" }, "msbuild-sdks": { "Microsoft.DotNet.Arcade.Sdk": "1.0.0-beta.19214.2" From 303c793a040f43339d19ba04f448e6267d724045 Mon Sep 17 00:00:00 2001 From: Vatsan Madhavan Date: Mon, 15 Apr 2019 18:35:50 -0700 Subject: [PATCH 3/3] Revert back to original global.json. We need a coherent build version to update the value of tools.dotnet and sdk.version. This is so because of the following chain of events: i. dotnet.tools downloads version A of core-sdk with version A' of Microsoft.NetCore.App ii. core-sdk version A contains Microsoft.WindowsDesktop.App, which contains windowsdesktop.app.runtimeconfig.json, which has a reference to Microsoft.NetCore.App version B. (A 'coherent build' would have pointed to Microsoft.NetCore.App version A', same as the one noted in (i), instead) iii. When running tests involving Sdk.WindowsDesktop, they start off using core-sdk version A/Microsoft.NetCore.App version A', and then look for Microsoft.NetCore.App version B (because WindowsDesktop.App.RuntimeConfig.json refers to it), and fails. Ideally, we should not be using Sdk.WindowsDesktop at all. Instead, we should be using InternalMarkupCompilation + ProjectReferences. For now, moving back to an older versin of tools.dotnet. We can update it to a newer (preview4) version later. --- .../tools/RuntimeFrameworkReference.targets | 10 +------ global.json | 30 +++++++++---------- 2 files changed, 16 insertions(+), 24 deletions(-) diff --git a/eng/WpfArcadeSdk/tools/RuntimeFrameworkReference.targets b/eng/WpfArcadeSdk/tools/RuntimeFrameworkReference.targets index a04e0e9783a..f21b197d136 100644 --- a/eng/WpfArcadeSdk/tools/RuntimeFrameworkReference.targets +++ b/eng/WpfArcadeSdk/tools/RuntimeFrameworkReference.targets @@ -14,14 +14,6 @@ - - + diff --git a/global.json b/global.json index 7f1153fd59a..5beb532cc2f 100644 --- a/global.json +++ b/global.json @@ -1,18 +1,18 @@ { - "tools": { - "dotnet": "3.0.100-preview4-011144", - "vs": { - "version": "16.0" + "tools": { + "dotnet": "3.0.100-preview-010024", + "vs": { + "version": "16.0" + } + }, + "sdk": { + "version": "3.0.100-preview-010024" + }, + "msbuild-sdks": { + "Microsoft.DotNet.Arcade.Sdk": "1.0.0-beta.19214.2" + }, + "native-tools": { + "strawberry-perl": "5.28.1.1-1", + "msvcurt-c1xx": "0.0.0.4" } - }, - "sdk": { - "version": "3.0.100-preview4-011144" - }, - "msbuild-sdks": { - "Microsoft.DotNet.Arcade.Sdk": "1.0.0-beta.19214.2" - }, - "native-tools": { - "strawberry-perl": "5.28.1.1-1", - "msvcurt-c1xx": "0.0.0.4" - } }