Skip to content

Commit 400e732

Browse files
committed
Disable W^X on Win7
1 parent cdbdbb0 commit 400e732

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

Program.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -208,6 +208,12 @@ private static void StartProcess(string relativePath, bool run32Bit = false, boo
208208
Environment.Exit(3);
209209
}
210210

211+
OperatingSystem os = Environment.OSVersion;
212+
213+
// Required on Win7 due to W^X causing issues there.
214+
if (os.Platform == PlatformID.Win32NT && os.Version.Major == 6 && os.Version.Minor == 1)
215+
Environment.SetEnvironmentVariable("DOTNET_EnableWriteXorExecute", "0");
216+
211217
using var _ = Process.Start(new ProcessStartInfo
212218
{
213219
FileName = dotnetHost.FullName,

0 commit comments

Comments
 (0)