Quantcast
Channel: Visual Studio Integrate forum
Viewing all articles
Browse latest Browse all 4410

IVSDebuger4.LaunchDebugTargets4 throws "Unable to attach" exception.

$
0
0

I am trying to launch VS debugger using the code below.

When I call debugger.LaunchDebugTargets, it throws the following exception:

"Unable to attach. Process 'C:\\vlh\\Test\\CPP\\Hello\\VS2017\\Debug\\Hello.exe' is not running on 'PPLUS-DEV-VLH-1'.\n\nRefresh the process list before attempting another attach."

HResult 0x89710080

What is wrong here?

        private void ButtonDebug_Click(object sender, RoutedEventArgs e)
        {
            ThreadHelper.ThrowIfNotOnUIThread();
            try
            {
                var debugger = Package.GetGlobalService(typeof(IVsDebugger)) as IVsDebugger4;
                VsDebugTargetInfo4[] targets = new VsDebugTargetInfo4[1];
                projectInfo.Initialize();
                targets[0].bstrExe = projectInfo.Command??"";
                targets[0].bstrArg = projectInfo.Args??"";
                VsDebugTargetProcessInfo[] processInfo = new VsDebugTargetProcessInfo[targets.Length];
                debugger.LaunchDebugTargets4(1, targets, processInfo);
            }
            catch(Exception ex)
            {
                LogMessage(ex.Message);
            }
        }


Viewing all articles
Browse latest Browse all 4410

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>