From 0d8dd220d5e85b63b942b52076f4a4614aae3f5c Mon Sep 17 00:00:00 2001 From: Igor Velikorossov Date: Mon, 31 May 2021 17:34:12 +1000 Subject: [PATCH] Ingest and import Windows Forms analyzer props Provide a mechanism to ingest Windows Forms specific analyzer props and targets into Microsoft.NET.Sdk.WindowsDesktop from Windows Forms transport package, and copy these files into `targets` folder of the SDK, so that the props files are resolved and imported when a developer builds a Windows Forms app. In the end the new props file will end up in a location similar to this: `C:\Program Files\dotnet\sdk\6.0.\Sdks\Microsoft.NET.Sdk.WindowsDesktop\targets\`. This work relates to https://github.com/dotnet/designs/pull/223, and acts as a workaround until https://github.com/dotnet/designs/pull/181 is approved and implemented. --- ....NET.Sdk.WindowsDesktop.ArchNeutral.csproj | 28 ++++++++++++++++++- .../Microsoft.NET.Sdk.WindowsDesktop.props | 3 ++ .../Microsoft.NET.Sdk.WindowsDesktop.targets | 3 ++ 3 files changed, 33 insertions(+), 1 deletion(-) diff --git a/packaging/Microsoft.NET.Sdk.WindowsDesktop/Microsoft.NET.Sdk.WindowsDesktop.ArchNeutral.csproj b/packaging/Microsoft.NET.Sdk.WindowsDesktop/Microsoft.NET.Sdk.WindowsDesktop.ArchNeutral.csproj index 275fd4a4cb9..ef86e36c422 100644 --- a/packaging/Microsoft.NET.Sdk.WindowsDesktop/Microsoft.NET.Sdk.WindowsDesktop.ArchNeutral.csproj +++ b/packaging/Microsoft.NET.Sdk.WindowsDesktop/Microsoft.NET.Sdk.WindowsDesktop.ArchNeutral.csproj @@ -1,4 +1,4 @@ - + {440d06b8-e3de-4c0d-ad25-cd4f43d836e1} net6.0 @@ -25,4 +25,30 @@ + + + + <_WinFormsNuGetPath>$(PkgMicrosoft_Private_Winforms) + <_WinFormsContentPath>$(_WinFormsNuGetPath)\sdk\dotnet-wpf\* + + + + + + + + + + + + <_WinFormsContent Include="$(_WinFormsContentPath)" /> + + + + diff --git a/packaging/Microsoft.NET.Sdk.WindowsDesktop/targets/Microsoft.NET.Sdk.WindowsDesktop.props b/packaging/Microsoft.NET.Sdk.WindowsDesktop/targets/Microsoft.NET.Sdk.WindowsDesktop.props index d04f9b04b58..32b555a5d4e 100644 --- a/packaging/Microsoft.NET.Sdk.WindowsDesktop/targets/Microsoft.NET.Sdk.WindowsDesktop.props +++ b/packaging/Microsoft.NET.Sdk.WindowsDesktop/targets/Microsoft.NET.Sdk.WindowsDesktop.props @@ -161,4 +161,7 @@ + + + diff --git a/packaging/Microsoft.NET.Sdk.WindowsDesktop/targets/Microsoft.NET.Sdk.WindowsDesktop.targets b/packaging/Microsoft.NET.Sdk.WindowsDesktop/targets/Microsoft.NET.Sdk.WindowsDesktop.targets index edadf38f4b3..7634aae5edb 100644 --- a/packaging/Microsoft.NET.Sdk.WindowsDesktop/targets/Microsoft.NET.Sdk.WindowsDesktop.targets +++ b/packaging/Microsoft.NET.Sdk.WindowsDesktop/targets/Microsoft.NET.Sdk.WindowsDesktop.targets @@ -155,4 +155,7 @@ + + +