From 327f6f43000c5b1060d9da402dca0b0e51a748d0 Mon Sep 17 00:00:00 2001 From: Viktor Hofer Date: Tue, 10 Jan 2023 16:12:47 +0100 Subject: [PATCH] Remove Drawing.Common .NETCoreApp PNSEs System.Drawing.Common was throwing PNSEs on non Windows platforms when accessing public API which makes sense as the library isn't supposed to be used on other platforms. That said, we already have a runtime hook that throws when DllImports are invoked. We intentionally want to allow accessing Drawing exchange types to not break customers when they don't rely on GDI+ or other native functions. This is also part of a wider effort that allows this library to be ported to another repository (which doesn't support targeting RIDs). --- .../src/System.Drawing.Common.csproj | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/src/libraries/System.Drawing.Common/src/System.Drawing.Common.csproj b/src/libraries/System.Drawing.Common/src/System.Drawing.Common.csproj index 52aecc09fc2a9..8ce552a5a97b0 100644 --- a/src/libraries/System.Drawing.Common/src/System.Drawing.Common.csproj +++ b/src/libraries/System.Drawing.Common/src/System.Drawing.Common.csproj @@ -1,6 +1,6 @@ - $(NetCoreAppCurrent)-windows;$(NetCoreAppCurrent);$(NetCoreAppPrevious)-windows;$(NetCoreAppPrevious);$(NetCoreAppMinimum)-windows;$(NetCoreAppMinimum);netstandard2.0;$(NetFrameworkMinimum) + $(NetCoreAppCurrent);$(NetCoreAppPrevious);$(NetCoreAppMinimum);netstandard2.0;$(NetFrameworkMinimum) $(DefineConstants);DRAWING_NAMESPACE true CS0618 @@ -22,13 +22,12 @@ Since .NET 7, non-Windows platforms are not supported, even with the runtime con - $([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) - $(DefineConstants);FEATURE_WINDOWS_SYSTEM_COLORS;FEATURE_SYSTEM_EVENTS + $(DefineConstants);FEATURE_WINDOWS_SYSTEM_COLORS;FEATURE_SYSTEM_EVENTS true - SR.SystemDrawingCommon_PlatformNotSupported + SR.SystemDrawingCommon_PlatformNotSupported - + @@ -369,7 +368,7 @@ Since .NET 7, non-Windows platforms are not supported, even with the runtime con LogicalName="System.Drawing.ShieldIcon.ico" /> - +