-
Notifications
You must be signed in to change notification settings - Fork 10
Open
Description
Seems like it requires a vs extension:
// All needed types are in Microsoft.VisualStudio.Shell.Interop namespace
var debugger = (IVsDebugger4)GetService(typeof(IVsDebugger));
// We need to pass a special type to 'bstrOptions' below
const string prefix = "SyntaxTree.VisualStudio.Unity";
var debuggerHostAssembly = AppDomain.CurrentDomain.GetAssemblies(). First(a => a.GetName(). Name == prefix);
var debuggerHostType = $"{prefix}. Debugger.DebugEngineHost, {debuggerHostAssembly.FullName}";
// you can add several targets if you want
var targets = new VsDebugTargetInfo4[1];
targets[0].dlo = (uint)DEBUG_LAUNCH_OPERATION. DLO_Custom;
targets[0].bstrExe = "Unity";
targets[0].fSendToOutputWindow = true;
targets[0].guidLaunchDebugEngine = new Guid("F18A0491-A310-4822-B12F-12CC30404EEC"); // this is the Unity Debugger Engine Guid
targets[0].bstrOptions = $"127.0.0.1:56872|{debuggerHostType}"; // ip/port of the local or remote Editor/Player
// Attach to targets
var results = new VsDebugTargetProcessInfo[targets. Length];
debugger. LaunchDebugTargets4((uint)targets. Length, targets, results);
Metadata
Metadata
Assignees
Labels
No labels