From e6df0cccc4f05a29de11743ce83cd3afedf3433f Mon Sep 17 00:00:00 2001 From: UnknownShadow200 Date: Sat, 17 May 2025 07:57:12 +1000 Subject: [PATCH] Make it possible to compile commands/plugins with more modern C# features in some cases on Windows Does require Visual Studio to be installed --- MCGalaxy/Modules/Compiling/CompilerBackends.cs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/MCGalaxy/Modules/Compiling/CompilerBackends.cs b/MCGalaxy/Modules/Compiling/CompilerBackends.cs index e9b689b1c..d1d2e0606 100644 --- a/MCGalaxy/Modules/Compiling/CompilerBackends.cs +++ b/MCGalaxy/Modules/Compiling/CompilerBackends.cs @@ -193,6 +193,8 @@ namespace MCGalaxy.Modules.Compiling string root = RuntimeEnvironment.GetRuntimeDirectory(); string[] paths = new string[] { + // Modern Visual Studio compilers + @"C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Current\Bin\Roslyn\csc.exe", // First try new C# compiler Path.Combine(root, "csc.exe"), // Then fallback to old Mono C# compiler