|
@@ -10,6 +10,10 @@ public static class SkNativeDependencyCompatibilityChecker
|
|
|
|
|
|
|
|
public static void Test()
|
|
public static void Test()
|
|
|
{
|
|
{
|
|
|
|
|
+ const string exceptionBaseMessage = "The QuestPDF library has encountered an issue while loading one of its dependencies.";
|
|
|
|
|
+ var newLine = Environment.NewLine;
|
|
|
|
|
+ var paragraph = newLine + newLine;
|
|
|
|
|
+
|
|
|
if (IsCompatibilityChecked)
|
|
if (IsCompatibilityChecked)
|
|
|
return;
|
|
return;
|
|
|
|
|
|
|
@@ -22,9 +26,19 @@ public static class SkNativeDependencyCompatibilityChecker
|
|
|
IsCompatibilityChecked = true;
|
|
IsCompatibilityChecked = true;
|
|
|
return;
|
|
return;
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
- if (SkNativeDependencyProvider.IsCurrentPlatformSupported())
|
|
|
|
|
- throw new InitializationException($"Your runtime is currently not supported by QuestPDF.");
|
|
|
|
|
|
|
+
|
|
|
|
|
+ if (!SkNativeDependencyProvider.IsCurrentPlatformSupported())
|
|
|
|
|
+ {
|
|
|
|
|
+ var message =
|
|
|
|
|
+ $"{exceptionBaseMessage}{paragraph}" +
|
|
|
|
|
+ "Your runtime is currently not supported by QuestPDF. " +
|
|
|
|
|
+ "Currently supported runtimes are: win-x64, linux-x64, osx-x64, osx-arm64.";
|
|
|
|
|
+
|
|
|
|
|
+ if (RuntimeInformation.ProcessArchitecture == Architecture.X64)
|
|
|
|
|
+ message += $"{paragraph}Please consider setting the 'Platform target' property to 'x64' in your project settings.";
|
|
|
|
|
+
|
|
|
|
|
+ throw new InitializationException(message, innerException);
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
// detect platform, copy appropriate native files and test compatibility again
|
|
// detect platform, copy appropriate native files and test compatibility again
|
|
|
SkNativeDependencyProvider.EnsureNativeFileAvailability();
|
|
SkNativeDependencyProvider.EnsureNativeFileAvailability();
|
|
@@ -37,9 +51,7 @@ public static class SkNativeDependencyCompatibilityChecker
|
|
|
return;
|
|
return;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- var initializationExceptionMessage = $"The QuestPDF library has encountered an issue while loading one of its dependencies.";
|
|
|
|
|
-
|
|
|
|
|
- throw new Exception(initializationExceptionMessage, innerException);
|
|
|
|
|
|
|
+ throw new Exception(exceptionBaseMessage, innerException);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
private static Exception? CheckIfExceptionIsThrownWhenLoadingNativeDependencies()
|
|
private static Exception? CheckIfExceptionIsThrownWhenLoadingNativeDependencies()
|