-
Notifications
You must be signed in to change notification settings - Fork 4.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[release/6.0-preview7] Make System.Drawing.Common throw on Unix unles…
…s a config switch is set (#56114) * Make System.Drawing.Common throw on Unix unless a config switch is set * Update src/libraries/System.Drawing.Common/src/Resources/Strings.resx Co-authored-by: Immo Landwerth <immo@landwerth.net> * Update src/libraries/System.Drawing.Common/src/Resources/Strings.resx * Add test that validates the exception is thrown * Move throw check to LibraryResolver.EnsureRegistered * Update src/libraries/System.Drawing.Common/src/System/Drawing/GdiplusNative.Unix.cs * Update package description * Enable Drawing support for Unix for resources tests * Enable drawing unix support on more tests Co-authored-by: Santiago Fernandez Madero <safern@microsoft.com> Co-authored-by: Immo Landwerth <immo@landwerth.net>
- Loading branch information
1 parent
91e4d50
commit b0cf153
Showing
11 changed files
with
67 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
20 changes: 20 additions & 0 deletions
20
src/libraries/System.Drawing.Common/src/System/Drawing/LocalAppContextSwitches.Unix.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
// Licensed to the .NET Foundation under one or more agreements. | ||
// The .NET Foundation licenses this file to you under the MIT license. | ||
|
||
using System.Runtime.CompilerServices; | ||
|
||
namespace System | ||
{ | ||
internal static partial class LocalAppContextSwitches | ||
{ | ||
private static int s_enableUnixSupport; | ||
public static bool EnableUnixSupport | ||
{ | ||
[MethodImpl(MethodImplOptions.AggressiveInlining)] | ||
get | ||
{ | ||
return GetCachedSwitchValue(@"System.Drawing.EnableUnixSupport", ref s_enableUnixSupport); | ||
} | ||
} | ||
} | ||
} |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5 changes: 5 additions & 0 deletions
5
src/libraries/System.Drawing.Common/tests/runtimeconfig.template.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{ | ||
"configProperties": { | ||
"System.Drawing.EnableUnixSupport": true | ||
} | ||
} |
5 changes: 5 additions & 0 deletions
5
src/libraries/System.Resources.Extensions/tests/runtimeconfig.template.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{ | ||
"configProperties": { | ||
"System.Drawing.EnableUnixSupport": true | ||
} | ||
} |
5 changes: 5 additions & 0 deletions
5
src/libraries/System.Resources.ResourceManager/tests/runtimeconfig.template.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{ | ||
"configProperties": { | ||
"System.Drawing.EnableUnixSupport": true | ||
} | ||
} |
5 changes: 5 additions & 0 deletions
5
src/libraries/System.Runtime.Serialization.Formatters/tests/runtimeconfig.template.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{ | ||
"configProperties": { | ||
"System.Drawing.EnableUnixSupport": true | ||
} | ||
} |