Browse Source

Improved the exception message related to the "Any CPU" architecture incompatibility.

Marcin Ziąbek 1 year ago
parent
commit
fdc8acd41c

+ 1 - 0
Source/QuestPDF/Resources/ReleaseNotes.txt

@@ -30,3 +30,4 @@ Version 2024.7.2
 Version 2024.7.3
 - Introduced FontDiscoveryPaths setting for specifying directories for automatic font registration and improved font search performance.
 - Updated native dependencies: from skia m126 to m128.
+- Improved the exception message related to the "Any CPU" architecture incompatibility.

+ 3 - 0
Source/QuestPDF/Skia/SkNativeDependencyCompatibilityChecker.cs

@@ -60,6 +60,9 @@ internal static class SkNativeDependencyCompatibilityChecker
             {
                 message += $"{paragraph}Your current runtime is detected as '{currentRuntime}'.";
             }
+
+            if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
+                message += $"{paragraph}Please always set the 'Platform target' to either 'X86' or 'X64' in your startup project settings. Please do not use the 'Any CPU' option.";
             
             if (RuntimeInformation.ProcessArchitecture is Architecture.Arm)
                 message += $"{paragraph}Please consider setting the 'Platform target' property to 'Arm64' in your project settings.";