Skip to content

Commit d936238

Browse files
committed
Use a static constructor instead of the property initialization because that doesn't seem to work.
1 parent f428c36 commit d936238

File tree

1 file changed

+11
-5
lines changed

1 file changed

+11
-5
lines changed

src/Magick.NET/Helpers/Runtime.cs

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,18 +6,24 @@
66

77
namespace ImageMagick;
88

9-
internal static partial class Runtime
9+
internal static class Runtime
1010
{
11-
public static bool Is64Bit { get; } = Architecture is Architecture.X64 or Architecture.Arm64;
11+
static Runtime()
12+
{
13+
Architecture = GetArchitecture();
14+
Is64Bit = Architecture is Architecture.X64 or Architecture.Arm64;
15+
IsWindows = RuntimeInformation.IsOSPlatform(OSPlatform.Windows);
16+
}
1217

13-
public static Architecture Architecture { get; } = GetArchitecture();
18+
public static bool Is64Bit { get; }
1419

15-
public static bool IsWindows { get; } = RuntimeInformation.IsOSPlatform(OSPlatform.Windows);
20+
public static Architecture Architecture { get; }
21+
22+
public static bool IsWindows { get; }
1623

1724
private static Architecture GetArchitecture()
1825
{
1926
var processArchitecture = RuntimeInformation.ProcessArchitecture;
20-
2127
return processArchitecture switch
2228
{
2329
Architecture.X64 or Architecture.Arm64 or Architecture.X86 => processArchitecture,

0 commit comments

Comments
 (0)