You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// 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);
The text was updated successfully, but these errors were encountered:
https://developercommunity.visualstudio.com/t/Provide-a-way-to-automate-attaching-Unit/10498892?space=8&q=unity+tools+autocomplete
Seems like it requires a vs extension:
The text was updated successfully, but these errors were encountered: