2

I have visual studio opened on my laptop, I want to run the visual, i.e trigger start without debugging automatically, for this below is the script I have referred and written.

///code area $vsInstance = [System.Runtime.InteropServices.Marshal]::GetActiveObject("VisualStudio.DTE")

$vsInstance.ExecuteCommand("Debug.Start")

Start-Sleep -Seconds 30 /////

Now whenever I run this script. I get the exception as showed in the image, Can you please help. Exception

I tried the above script but failed.

  • See if the (currently) last two answer at https://stackoverflow.com/q/7736280/45375 help (running either both your script and Visual Studio with elevation, or neither). – mklement0 Aug 04 '23 at 16:31

0 Answers0