From 1cfb6cdf24a19c7bcd8a76fc02bcd8fefae82233 Mon Sep 17 00:00:00 2001 From: sdflysha Date: Fri, 1 Nov 2019 13:47:39 +0800 Subject: [PATCH] Fix a compatible issue in .NET Core There was a breaking change in .NET Core - they changed the default for UseShellExecute from true to false. Without UseShellExecute, it will work reliably only in .NET Framework. In .NET Core, it will fail unless the 7zdec.exe file happens to be in the current directory. --- src/System.Numerics.MPFR/ModuleInitializer.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/System.Numerics.MPFR/ModuleInitializer.cs b/src/System.Numerics.MPFR/ModuleInitializer.cs index 336561f..474d61c 100644 --- a/src/System.Numerics.MPFR/ModuleInitializer.cs +++ b/src/System.Numerics.MPFR/ModuleInitializer.cs @@ -165,6 +165,7 @@ private void InstallInternalLibrary() WorkingDirectory = AssemblyLocation, Arguments = "x mpfr_gmp.7z", WindowStyle = System.Diagnostics.ProcessWindowStyle.Hidden, + UseShellExecute = true, }; var proc = Process.Start(info); proc.WaitForExit(); @@ -262,4 +263,4 @@ public enum LoadLibraryFlags : uint LOAD_LIBRARY_SEARCH_SYSTEM32 = 0x00000800, LOAD_LIBRARY_SEARCH_DEFAULT_DIRS = 0x00001000 } -} \ No newline at end of file +}