Merge pull request #112961 from Repiteo/dotnet/vs2026-support

C#: Ensure mono editor supports Visual Studio 2026
This commit is contained in:
Thaddeus Crews 2025-11-20 11:10:45 -06:00
commit d089d0e1e2
No known key found for this signature in database
GPG key ID: 8C6E5FEB5FC03CCC

View file

@ -46,19 +46,13 @@ namespace GodotTools.OpenVisualStudio
if (dte == null) if (dte == null)
{ {
// Open a new instance dte = TryVisualStudioLaunch("VisualStudio.DTE.18.0") // Visual Studio 18 (2026).
dte = TryVisualStudioLaunch("VisualStudio.DTE.17.0"); ?? TryVisualStudioLaunch("VisualStudio.DTE.17.0"); // Visual Studio 17 (2022).
if (dte == null) if (dte == null)
{ {
// Launch of VS 2022 failed, fallback to 2019 Console.Error.WriteLine("Could not find a supported Visual Studio version (VS 2026 or VS 2022).");
dte = TryVisualStudioLaunch("VisualStudio.DTE.16.0"); return 1;
if (dte == null)
{
Console.Error.WriteLine("Visual Studio not found");
return 1;
}
} }
dte.UserControl = true; dte.UserControl = true;
@ -188,8 +182,8 @@ namespace GodotTools.OpenVisualStudio
if (ppszDisplayName == null) if (ppszDisplayName == null)
continue; continue;
// The digits after the colon are the process ID // The digits after the colon are the process ID.
if (!Regex.IsMatch(ppszDisplayName, "!VisualStudio.DTE.1[6-7].0:[0-9]")) if (!Regex.IsMatch(ppszDisplayName, "!VisualStudio.DTE.1[7-8].0:[0-9]"))
continue; continue;
if (pprot.GetObject(moniker[0], out object ppunkObject) == 0) if (pprot.GetObject(moniker[0], out object ppunkObject) == 0)