From 9039d401da22525d47c8087b19eb252f17fb0d78 Mon Sep 17 00:00:00 2001 From: 2dust <31833384+2dust@users.noreply.github.com> Date: Fri, 21 Jun 2024 14:09:57 +0800 Subject: [PATCH] set DOTNET_EnableWriteXorExecute=0 under win10 https://github.com/2dust/v2rayN/issues/5186 --- v2rayN/v2rayN/App.xaml.cs | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/v2rayN/v2rayN/App.xaml.cs b/v2rayN/v2rayN/App.xaml.cs index a8571737..7348d354 100644 --- a/v2rayN/v2rayN/App.xaml.cs +++ b/v2rayN/v2rayN/App.xaml.cs @@ -58,10 +58,12 @@ namespace v2rayN Environment.Exit(0); return; } - //if (RuntimeInformation.ProcessArchitecture != Architecture.X86 && RuntimeInformation.ProcessArchitecture != Architecture.X64) - //{ - // _config.guiItem.enableStatistics = false; - //} + + //Under Win10 + if (Environment.OSVersion.Version.Major < 10) + { + Environment.SetEnvironmentVariable("DOTNET_EnableWriteXorExecute", "0", EnvironmentVariableTarget.Process); + } } private void App_DispatcherUnhandledException(object sender, DispatcherUnhandledExceptionEventArgs e)