Start Debugging Results in Error

Hello! I’ve looked over the documentation, but I’m hoping there’s something I’ve overlooked and the community can help.

I’ve tried running just a basic “Get-Process” script in the module as a test after purchase and installation, but I receive an error when starting to run/debug.

I tried attaching to a PowerShell process, but received another error, but I’m a new user so I’m unable to attach a second image of the error…essentially, the requested attach was not completed, but it successfully attached these types of code: Managed (4.6, 4.5, and 4.0).

I’ve tried in both a clean install of 2019 Community edition as well as a trial of Enterprise. Debugging a C#/WPF app works as expected. Any help would be appreciated. Thanks!

–Brad

VS Code is throwing this when trying to run the script:

Unable to find type [Windows.Markup.XamlReader].

I found a post from another user finding that Singled Threaded Apartment needed to be enabled in the options to run the XAML/WPF scripts. I enabled it but, but no joy. As with the other user’s experience, PowerShell ISE runs the script just fine. Another post referenced Add-Type for PresentationFramework, but that was a negative as well.

I suppose I can design in Visual Studio and test run in ISE for now. I’ll continue to investigate and post back anything to help others who may run into this.

Hi Brad,

Are you using PowerShell 5.1 or a more recent version of PowerShell? Can you also please enable logging for PoshTools by going to Tools->Options->PowerShell Tools->Diagnostics and then enable logging. It might provide some more information as to why you can’t launch scripts.

Hey, Adam. Thanks for the reply. I’m loving the extension so far, despite my issue. :slight_smile:

Yes, PS version 5.1.19041.1. The diag output shows only one error…

[1] ERROR PowerShellTools.PowerShellToolsPackage (null) - Failed to inject control
System.NullReferenceException: Object reference not set to an instance of an object.
at PowerShellTools.PowerShellToolsPackage.d__49.MoveNext()

Also, I see it says PS Tools version is 5.4.9, but VS is showing 5.5.1, not sure if I’m a little outdated but don’t know it. Full diag output below.

-EDIT- I added more from the log that shows a few unknown errors an unable to start debugging messages.

[33] INFO PowerShellTools.Diagnostics.DiagnosticConfiguration (null) - Diagnostics enabled.
[33] INFO PowerShellTools.PowerShellToolsPackage (null) - PowerShellToolsPackage()
[33] INFO PowerShellTools.PowerShellToolsPackage (null) - InitializeAsync()
[1] ERROR PowerShellTools.PowerShellToolsPackage (null) - Failed to inject control
System.NullReferenceException: Object reference not set to an instance of an object.
at PowerShellTools.PowerShellToolsPackage.d__49.MoveNext()
[1] INFO PowerShellTools.PowerShellToolsPackage (null) - Switch to main thread
[1] INFO PowerShellTools.PowerShellToolsPackage (null) - PowerShell Tools Version: 5.4.9.0
[1] INFO PowerShellTools.PowerShellToolsPackage (null) - Visual Studio Version: 16.0
[1] INFO PowerShellTools.PowerShellToolsPackage (null) - Windows Version: Microsoft Windows NT 10.0.19041.0
[1] INFO PowerShellTools.PowerShellToolsPackage (null) - Current Culture: en-US
[1] INFO PowerShellTools.PowerShellToolsPackage (null) - Entering Initialize() of: PowerShellTools.PowerShellToolsPackage
[1] INFO PowerShellTools.PowerShellToolsPackage (null) - Adding language service
[1] INFO PowerShellTools.PowerShellToolsPackage (null) - Getting adapters factory
[1] INFO PowerShellTools.PowerShellToolsPackage (null) - RefreshCommands
[1] INFO PowerShellTools.PowerShellToolsPackage (null) - Done RefreshCommands
[1] INFO PowerShellTools.PowerShellToolsPackage (null) - InitializePowerShellHost
[1] INFO PowerShellTools.PowerShellToolsPackage (null) - Opening PowerShell host connection
[1] DEBUG PowerShellTools.ServiceManagement.PowershellHostProcessHelper (null) - Starting host path. Bitness: C:\WINDOWS\system32\WindowsPowerShell\v1.0\powershell.exe
[1] DEBUG PowerShellTools.ServiceManagement.PowershellHostProcessHelper (null) - Host path: ‘C:\WINDOWS\system32\WindowsPowerShell\v1.0\powershell.exe’ Host arguments: ‘-NoExit -Sta -NoProfile -NonInteractive -Command &{ Import-Module ‘c:\program files (x86)\microsoft visual studio\2019\enterprise\common7\ide\extensions\z3g3vs1n.2pe\HostService.dll’; [PowerShellTools.HostService.ServiceCommon]::Startup(5780); }’
[1] INFO PowerShellTools.HostService.ServiceCommon (null) - Initializing debugging engine service …
[1] INFO PowerShellTools.HostService.ServiceCommon (null) - Initializing run space with debugger
[1] INFO PowerShellTools.HostService.ServiceCommon (null) - Providing $profile variable to the local runspace.
[1] INFO PowerShellTools.HostService.ServiceCommon (null) - Done initializing runspace
[1] INFO PowerShellTools.PowerShellToolsPackage (null) - Finished opening PowerShell host connection
[1] INFO PowerShellTools.HostService.ServiceCommon (null) - Setting execution policy
[1] INFO PowerShellTools.PowerShellToolsPackage (null) - Initializing IntelliSense
[1] INFO PowerShellTools.PowerShellToolsPackage (null) - Debugger is ready
[1] INFO PowerShellTools.PowerShellToolsPackage (null) - Loading profiles
[1] INFO PowerShellTools.HostService.ServiceCommon (null) - Loading PowerShell Profiles
[1] INFO PowerShellTools.PowerShellToolsPackage (null) - Done loading profiles
[1] INFO PowerShellTools.PowerShellToolsPackage (null) - Set repl location to solution dir
[1] INFO PowerShellTools.HostService.ServiceCommon (null) - Start executing ps script …
[1] INFO PowerShellTools.HostService.ServiceCommon (null) - DebuggerFinished
[1] INFO PowerShellTools.HostService.ServiceCommon (null) - Clearing all breakpoints
[1] INFO PowerShellTools.HostService.ServiceCommon (null) - Checking runspace availability: Available
[1] INFO PowerShellTools.HostService.ServiceCommon (null) - Providing $dte variable to the local runspace.
[1] INFO PowerShellTools.PowerShellToolsPackage (null) - Done InitializeInternal()
[1] INFO PowerShellTools.PowerShellToolsPackage (null) - RegisterServices
[1] INFO PowerShellTools.PowerShellToolsPackage (null) - Done RegisterServices
[1] INFO PowerShellTools.PowerShellToolsPackage (null) - Set PacakgeInitialized
[1] INFO PowerShellTools.PowerShellToolsPackage (null) - Done InitializeAsync()
[1] INFO PowerShellTools.HostService.ServiceCommon (null) - Providing $dte variable to the local runspace.
[1] DEBUG PowerShellTools.Intellisense.IntelliSenseManager (null) - Non-VSStd2K command: ‘CommandGroup: 5efc7975-14bc-11cf-9b2b-00aa00573819, Id: 684’
[1] DEBUG PowerShellTools.Intellisense.IntelliSenseManager (null) - Non-VSStd2K command: ‘CommandGroup: 1496a755-94de-11d0-8c3f-00c04fc2aae2, Id: 1990’
[1] DEBUG PowerShellTools.Intellisense.IntelliSenseManager (null) - Non-VSStd2K command: ‘CommandGroup: 5efc7975-14bc-11cf-9b2b-00aa00573819, Id: 224’
[1] DEBUG PowerShellTools.Intellisense.IntelliSenseManager (null) - Non-VSStd2K command: ‘CommandGroup: 5efc7975-14bc-11cf-9b2b-00aa00573819, Id: 684’
[1] DEBUG PowerShellTools.Intellisense.IntelliSenseManager (null) - Non-VSStd2K command: ‘CommandGroup: 1496a755-94de-11d0-8c3f-00c04fc2aae2, Id: 1990’
[1] DEBUG PowerShellTools.Intellisense.IntelliSenseManager (null) - Non-VSStd2K command: ‘CommandGroup: 5efc7975-14bc-11cf-9b2b-00aa00573819, Id: 684’
[1] DEBUG PowerShellTools.Intellisense.IntelliSenseManager (null) - Non-VSStd2K command: ‘CommandGroup: 1496a755-94de-11d0-8c3f-00c04fc2aae2, Id: 1990’
[1] DEBUG PowerShellTools.Intellisense.IntelliSenseManager (null) - Non-VSStd2K command: ‘CommandGroup: 5efc7975-14bc-11cf-9b2b-00aa00573819, Id: 684’
[1] DEBUG PowerShellTools.Intellisense.IntelliSenseManager (null) - Non-VSStd2K command: ‘CommandGroup: 1496a755-94de-11d0-8c3f-00c04fc2aae2, Id: 1990’
[1] DEBUG PowerShellTools.Intellisense.IntelliSenseManager (null) - Non-VSStd2K command: ‘CommandGroup: 5efc7975-14bc-11cf-9b2b-00aa00573819, Id: 295’
[1] DEBUG PowerShellTools.Project.PowerShellProjectLauncher (null) - PowerShellProjectLauncher.LaunchProject
[1] DEBUG PowerShellTools.DebugEngine.ScriptDebugProcess (null) - Process: Constructor
[1] DEBUG PowerShellTools.DebugEngine.ScriptDebugProcess (null) - Process: GetPhysicalProcessId
[1] DEBUG PowerShellTools.DebugEngine.ScriptDebugProcess (null) - Process: GetProcessId
[1] DEBUG PowerShellTools.DebugEngine.ScriptProgramProvider (null) - ProgramProvider: SetLocale
[1] DEBUG PowerShellTools.DebugEngine.ScriptProgramProvider (null) - ProgramProvider: WatchForProviderEvents
[1] DEBUG PowerShellTools.DebugEngine.ScriptDebugProcess (null) - Process: GetPort
[1] DEBUG PowerShellTools.DebugEngine.ScriptProgramNode (null) - ScriptProgramNode: Entering GetHostPid
[1] DEBUG PowerShellTools.DebugEngine.ScriptProgramNode (null) - ScriptProgramNode: Entering GetEngineInfo
[1] DEBUG PowerShellTools.DebugEngine.ScriptProgramNode (null) - ScriptProgramNode: Entering OnAttach
[1] DEBUG PowerShellTools.DebugEngine.Engine (null) - Attaching the debug engine.
[1] DEBUG PowerShellTools.DebugEngine.Engine (null) - Publishing node
[1] DEBUG PowerShellTools.Intellisense.IntelliSenseManager (null) - Non-VSStd2K command: ‘CommandGroup: 5efc7975-14bc-11cf-9b2b-00aa00573819, Id: 179’
[1] DEBUG PowerShellTools.DebugEngine.Engine (null) - Engine: CanTerminateProcess
[1] DEBUG PowerShellTools.DebugEngine.Engine (null) - Engine: TerminateProcess
[1] DEBUG PowerShellTools.DebugEngine.ScriptProgramNode (null) - ScriptProgramNode: Entering GetHostPid
[1] INFO PowerShellTools.DebugEngine.ScriptDebugger (null) - Stop
[1] DEBUG PowerShellTools.HostService.ServiceManagement.Debugging.PowerShellDebuggingService (null) - Stop()
[1] INFO PowerShellTools.DebugEngine.ScriptDebugger (null) - Stop complete.
[1] DEBUG PowerShellTools.Intellisense.IntelliSenseManager (null) - Non-VSStd2K command: ‘CommandGroup: 5efc7975-14bc-11cf-9b2b-00aa00573819, Id: 684’
[1] DEBUG PowerShellTools.Intellisense.IntelliSenseManager (null) - Non-VSStd2K command: ‘CommandGroup: 1496a755-94de-11d0-8c3f-00c04fc2aae2, Id: 1990’
[1] DEBUG PowerShellTools.Intellisense.IntelliSenseManager (null) - Non-VSStd2K command: ‘CommandGroup: 5efc7975-14bc-11cf-9b2b-00aa00573819, Id: 684’
[1] DEBUG PowerShellTools.Intellisense.IntelliSenseManager (null) - Non-VSStd2K command: ‘CommandGroup: 1496a755-94de-11d0-8c3f-00c04fc2aae2, Id: 1990’
[1] DEBUG PowerShellTools.Intellisense.IntelliSenseManager (null) - Non-VSStd2K command: ‘CommandGroup: 5efc7975-14bc-11cf-9b2b-00aa00573819, Id: 219’
[37] INFO PowerShellTools.Diagnostics.DiagnosticConfiguration (null) - Diagnostics enabled.
[37] INFO PowerShellTools.PowerShellToolsPackage (null) - PowerShellToolsPackage()
[37] INFO PowerShellTools.PowerShellToolsPackage (null) - InitializeAsync()
[1] INFO PowerShellTools.PowerShellToolsPackage (null) - Switch to main thread
[1] INFO PowerShellTools.PowerShellToolsPackage (null) - PowerShell Tools Version: 5.4.9.0
[1] INFO PowerShellTools.PowerShellToolsPackage (null) - Visual Studio Version: 16.0
[1] INFO PowerShellTools.PowerShellToolsPackage (null) - Windows Version: Microsoft Windows NT 10.0.19041.0
[1] INFO PowerShellTools.PowerShellToolsPackage (null) - Current Culture: en-US
[1] INFO PowerShellTools.PowerShellToolsPackage (null) - Entering Initialize() of: PowerShellTools.PowerShellToolsPackage
[1] INFO PowerShellTools.PowerShellToolsPackage (null) - Adding language service
[1] INFO PowerShellTools.PowerShellToolsPackage (null) - Getting adapters factory
[1] INFO PowerShellTools.PowerShellToolsPackage (null) - RefreshCommands
[1] INFO PowerShellTools.PowerShellToolsPackage (null) - Done RefreshCommands
[1] INFO PowerShellTools.PowerShellToolsPackage (null) - InitializePowerShellHost
[1] INFO PowerShellTools.PowerShellToolsPackage (null) - Opening PowerShell host connection
[1] DEBUG PowerShellTools.ServiceManagement.PowershellHostProcessHelper (null) - Starting host path. Bitness: C:\WINDOWS\system32\WindowsPowerShell\v1.0\powershell.exe
[1] DEBUG PowerShellTools.ServiceManagement.PowershellHostProcessHelper (null) - Host path: ‘C:\WINDOWS\system32\WindowsPowerShell\v1.0\powershell.exe’ Host arguments: ‘-NoExit -Sta -NoProfile -NonInteractive -Command &{ Import-Module ‘c:\program files (x86)\microsoft visual studio\2019\enterprise\common7\ide\extensions\z3g3vs1n.2pe\HostService.dll’; [PowerShellTools.HostService.ServiceCommon]::Startup(8460); }’
[1] INFO PowerShellTools.HostService.ServiceCommon (null) - Initializing debugging engine service …
[1] INFO PowerShellTools.HostService.ServiceCommon (null) - Initializing run space with debugger
[1] INFO PowerShellTools.HostService.ServiceCommon (null) - Providing $profile variable to the local runspace.
[1] INFO PowerShellTools.HostService.ServiceCommon (null) - Done initializing runspace
[1] INFO PowerShellTools.PowerShellToolsPackage (null) - Finished opening PowerShell host connection
[1] INFO PowerShellTools.HostService.ServiceCommon (null) - Setting execution policy
[1] INFO PowerShellTools.PowerShellToolsPackage (null) - Initializing IntelliSense
[1] INFO PowerShellTools.PowerShellToolsPackage (null) - Debugger is ready
[1] INFO PowerShellTools.PowerShellToolsPackage (null) - Loading profiles
[1] INFO PowerShellTools.HostService.ServiceCommon (null) - Loading PowerShell Profiles
[1] INFO PowerShellTools.PowerShellToolsPackage (null) - Done loading profiles
[1] INFO PowerShellTools.PowerShellToolsPackage (null) - Set repl location to solution dir
[1] INFO PowerShellTools.HostService.ServiceCommon (null) - Start executing ps script …
[1] INFO PowerShellTools.HostService.ServiceCommon (null) - DebuggerFinished
[1] INFO PowerShellTools.HostService.ServiceCommon (null) - Clearing all breakpoints
[1] INFO PowerShellTools.HostService.ServiceCommon (null) - Checking runspace availability: Available
[1] INFO PowerShellTools.HostService.ServiceCommon (null) - Providing $dte variable to the local runspace.
[1] INFO PowerShellTools.PowerShellToolsPackage (null) - Done InitializeInternal()
[1] INFO PowerShellTools.PowerShellToolsPackage (null) - RegisterServices
[1] INFO PowerShellTools.PowerShellToolsPackage (null) - Done RegisterServices
[1] INFO PowerShellTools.PowerShellToolsPackage (null) - Set PacakgeInitialized
[1] INFO PowerShellTools.PowerShellToolsPackage (null) - Done InitializeAsync()
[1] DEBUG PowerShellTools.Project.PowerShellProjectLauncher (null) - PowerShellProjectLauncher.LaunchProject
[1] DEBUG PowerShellTools.Project.PowerShellProjectLauncher (null) - Error:Unable to start debugging.

Operation not supported. Unknown error: 0x80070057.
[1] INFO PowerShellTools.HostService.ServiceCommon (null) - Providing $dte variable to the local runspace.
[1] DEBUG PowerShellTools.Project.PowerShellProjectLauncher (null) - PowerShellProjectLauncher.LaunchProject
[1] DEBUG PowerShellTools.Project.PowerShellProjectLauncher (null) - Error:Unable to start debugging.

Operation not supported. Unknown error: 0x80070057.
[1] DEBUG PowerShellTools.Project.PowerShellProjectLauncher (null) - PowerShellProjectLauncher.LaunchProject
[1] DEBUG PowerShellTools.Project.PowerShellProjectLauncher (null) - Error:Unable to start debugging.

Operation not supported. Unknown error: 0x80070057.
[1] DEBUG PowerShellTools.Intellisense.IntelliSenseManager (null) - Typed Character: ’ ’
[1] DEBUG PowerShellTools.Intellisense.IntelliSenseManager (null) - IsIntelliSenseTriggerInStringLiteral: [ ]
[1] DEBUG PowerShellTools.Intellisense.IntelliSenseManager (null) - IsIntelliSenseTriggerDot: [ ]
[8] DEBUG PowerShellTools.Classification.PowerShellTokenizationService (null) - Parsing input.
[8] DEBUG PowerShellTools.Classification.PowerShellTokenizationService (null) - Classifying tokens.
[1] DEBUG PowerShellTools.Intellisense.IntelliSenseManager (null) - IsIntellisenseTrigger: [ ]
[1] DEBUG PowerShellTools.Intellisense.IntelliSenseManager (null) - IsIntelliSenseTriggerDot: [ ]
[8] DEBUG PowerShellTools.Classification.PowerShellTokenizationService (null) - Matching braces and regions.
[8] DEBUG PowerShellTools.Classification.PowerShellTokenizationService (null) - Tagging error spans.
[1] DEBUG PowerShellTools.Intellisense.IntelliSenseManager (null) - IsFilterTrigger: [ ]
[1] DEBUG PowerShellTools.Classification.PowerShellOutliningTagger (null) - GetTags
[1] DEBUG PowerShellTools.Classification.PowerShellOutliningTagger (null) - Returning existing tag spans.
[8] DEBUG PowerShellTools.Classification.PowerShellOutliningTagger (null) - OnTagsChanged
[1] DEBUG PowerShellTools.Classification.PowerShellOutliningTagger (null) - GetTags
[1] DEBUG PowerShellTools.Classification.PowerShellOutliningTagger (null) - Updating with new tag spans.
[1] DEBUG PowerShellTools.Intellisense.IntelliSenseManager (null) - Typed Character: ’ ’
[1] DEBUG PowerShellTools.Intellisense.IntelliSenseManager (null) - IsIntelliSenseTriggerInStringLiteral: [ ]
[1] DEBUG PowerShellTools.Intellisense.IntelliSenseManager (null) - IsIntelliSenseTriggerDot: [ ]
[8] DEBUG PowerShellTools.Classification.PowerShellTokenizationService (null) - Parsing input.
[1] DEBUG PowerShellTools.Intellisense.IntelliSenseManager (null) - IsIntellisenseTrigger: [ ]
[1] DEBUG PowerShellTools.Intellisense.IntelliSenseManager (null) - IsIntelliSenseTriggerDot: [ ]
[1] DEBUG PowerShellTools.Intellisense.IntelliSenseManager (null) - IsFilterTrigger: [ ]
[8] DEBUG PowerShellTools.Classification.PowerShellTokenizationService (null) - Classifying tokens.
[8] DEBUG PowerShellTools.Classification.PowerShellTokenizationService (null) - Matching braces and regions.
[8] DEBUG PowerShellTools.Classification.PowerShellTokenizationService (null) - Tagging error spans.
[8] DEBUG PowerShellTools.Classification.PowerShellOutliningTagger (null) - OnTagsChanged
[1] DEBUG PowerShellTools.Classification.PowerShellOutliningTagger (null) - GetTags
[1] DEBUG PowerShellTools.Classification.PowerShellOutliningTagger (null) - Updating with new tag spans.
[1] DEBUG PowerShellTools.Project.PowerShellProjectLauncher (null) - PowerShellProjectLauncher.LaunchProject
[1] DEBUG PowerShellTools.Project.PowerShellProjectLauncher (null) - Error:Unable to start debugging.

Operation not supported. Unknown error: 0x80070057.
[1] DEBUG PowerShellTools.Intellisense.IntelliSenseManager (null) - Non-VSStd2K command: ‘CommandGroup: 5efc7975-14bc-11cf-9b2b-00aa00573819, Id: 684’
[1] DEBUG PowerShellTools.Intellisense.IntelliSenseManager (null) - Non-VSStd2K command: ‘CommandGroup: 1496a755-94de-11d0-8c3f-00c04fc2aae2, Id: 1990’
[1] DEBUG PowerShellTools.Intellisense.IntelliSenseManager (null) - Non-TypeChar command: ‘CommandGroup: 1496a755-94de-11d0-8c3f-00c04fc2aae2, Id: 2’
[1] DEBUG PowerShellTools.Intellisense.IntelliSenseManager (null) - IsIntelliSenseTriggerDot: [ ]
[8] DEBUG PowerShellTools.Classification.PowerShellTokenizationService (null) - Parsing input.
[1] DEBUG PowerShellTools.Intellisense.IntelliSenseManager (null) - IsIntellisenseTrigger: [ ]
[1] DEBUG PowerShellTools.Intellisense.IntelliSenseManager (null) - IsIntelliSenseTriggerDot: [ ]
[8] DEBUG PowerShellTools.Classification.PowerShellTokenizationService (null) - Classifying tokens.
[8] DEBUG PowerShellTools.Classification.PowerShellTokenizationService (null) - Matching braces and regions.
[8] DEBUG PowerShellTools.Classification.PowerShellTokenizationService (null) - Tagging error spans.
[8] DEBUG PowerShellTools.Classification.PowerShellOutliningTagger (null) - OnTagsChanged
[1] DEBUG PowerShellTools.Classification.PowerShellOutliningTagger (null) - GetTags
[1] DEBUG PowerShellTools.Classification.PowerShellOutliningTagger (null) - Updating with new tag spans.
[1] DEBUG PowerShellTools.Intellisense.IntelliSenseManager (null) - Non-TypeChar command: ‘CommandGroup: 1496a755-94de-11d0-8c3f-00c04fc2aae2, Id: 2’
[1] DEBUG PowerShellTools.Intellisense.IntelliSenseManager (null) - IsIntelliSenseTriggerDot: [ ]
[8] DEBUG PowerShellTools.Classification.PowerShellTokenizationService (null) - Parsing input.
[1] DEBUG PowerShellTools.Intellisense.IntelliSenseManager (null) - IsIntellisenseTrigger: [ ]
[1] DEBUG PowerShellTools.Intellisense.IntelliSenseManager (null) - IsIntelliSenseTriggerDot: [ ]
[8] DEBUG PowerShellTools.Classification.PowerShellTokenizationService (null) - Classifying tokens.
[8] DEBUG PowerShellTools.Classification.PowerShellTokenizationService (null) - Matching braces and regions.
[8] DEBUG PowerShellTools.Classification.PowerShellTokenizationService (null) - Tagging error spans.
[8] DEBUG PowerShellTools.Classification.PowerShellOutliningTagger (null) - OnTagsChanged
[1] DEBUG PowerShellTools.Classification.PowerShellOutliningTagger (null) - GetTags
[1] DEBUG PowerShellTools.Classification.PowerShellOutliningTagger (null) - Updating with new tag spans.
[1] DEBUG PowerShellTools.Intellisense.IntelliSenseManager (null) - Non-VSStd2K command: ‘CommandGroup: 5efc7975-14bc-11cf-9b2b-00aa00573819, Id: 684’
[1] DEBUG PowerShellTools.Intellisense.IntelliSenseManager (null) - Non-VSStd2K command: ‘CommandGroup: 1496a755-94de-11d0-8c3f-00c04fc2aae2, Id: 1990’
[1] DEBUG PowerShellTools.Intellisense.IntelliSenseManager (null) - Non-VSStd2K command: ‘CommandGroup: 5efc7975-14bc-11cf-9b2b-00aa00573819, Id: 224’
[1] DEBUG PowerShellTools.Intellisense.IntelliSenseManager (null) - Non-VSStd2K command: ‘CommandGroup: 5efc7975-14bc-11cf-9b2b-00aa00573819, Id: 295’
[1] DEBUG PowerShellTools.Project.PowerShellProjectLauncher (null) - PowerShellProjectLauncher.LaunchProject
[1] DEBUG PowerShellTools.DebugEngine.ScriptDebugProcess (null) - Process: Constructor
[1] DEBUG PowerShellTools.DebugEngine.ScriptDebugProcess (null) - Process: GetPhysicalProcessId
[1] DEBUG PowerShellTools.DebugEngine.ScriptDebugProcess (null) - Process: GetProcessId
[1] DEBUG PowerShellTools.DebugEngine.ScriptProgramProvider (null) - ProgramProvider: SetLocale
[1] DEBUG PowerShellTools.DebugEngine.ScriptProgramProvider (null) - ProgramProvider: WatchForProviderEvents
[1] DEBUG PowerShellTools.DebugEngine.ScriptDebugProcess (null) - Process: GetPort
[1] DEBUG PowerShellTools.DebugEngine.ScriptProgramNode (null) - ScriptProgramNode: Entering GetHostPid
[1] DEBUG PowerShellTools.DebugEngine.ScriptProgramNode (null) - ScriptProgramNode: Entering GetEngineInfo
[1] DEBUG PowerShellTools.DebugEngine.ScriptProgramNode (null) - ScriptProgramNode: Entering OnAttach
[1] DEBUG PowerShellTools.DebugEngine.Engine (null) - Attaching the debug engine.
[1] DEBUG PowerShellTools.DebugEngine.Engine (null) - Publishing node
[1] DEBUG PowerShellTools.Intellisense.IntelliSenseManager (null) - Non-VSStd2K command: ‘CommandGroup: 5efc7975-14bc-11cf-9b2b-00aa00573819, Id: 229’
[1] DEBUG PowerShellTools.DebugEngine.Engine (null) - Engine: CanTerminateProcess
[1] DEBUG PowerShellTools.DebugEngine.Engine (null) - Engine: TerminateProcess
[1] DEBUG PowerShellTools.DebugEngine.ScriptProgramNode (null) - ScriptProgramNode: Entering GetHostPid
[1] INFO PowerShellTools.DebugEngine.ScriptDebugger (null) - Stop
[1] DEBUG PowerShellTools.HostService.ServiceManagement.Debugging.PowerShellDebuggingService (null) - Stop()
[1] INFO PowerShellTools.DebugEngine.ScriptDebugger (null) - Stop complete.

Hi,

Just registered and testing PowerShell Tools Pro and I am getting exactly the same error as the OP. At the moment I can’t even trial the software. I noticed some logs posted above but no resolution.

Can you let me know which workloads\features\extensions you have installed in Visual Studio besides PoshTools?

I’ll be glad to help if I can. Would like to be able to get it to work in Visual Studio. I ended up moving over to VS Code for any PowerShell work. I’ve grown to tolerate it.

I am using full VS 2019, I have tried VS Code but struggle getting breakpoints to work reliably

Hi Adam,

I have desktop development and nothing else. I only really use PowerShell so don’t need to extra services in VS.

Can you email me at support@ironmansoftware.com? I’d like to schedule a call to look more into this issue.

For those running into this issue, I’ve narrowed down the reason it’s happening. It does have to do with missing dependencies in Visual Studio.

If you didn’t install any workloads, PowerShell Tools will install the .NET Desktop Development workload while attempting to install the extension. The problem is that this only installs a partial portion of the workload for some reason.

You’ll need to ensure that the following optional features are also installed after install PowerShell Tools. I’m sure not all of these are required but this works when installing on my machine.

image

The goal with the next version of the extension is to fix this issue so that, even if you just install the PoshTools extension, VS will also install the proper prereqs features.

Awesome! That did the trick for me once I added the missing features. Just tested in VS 2019 16.11.1.

Thanks for digging in and finding the cause, Adam.

–Brad

1 Like

This has been fixed in our main branch and will be in 2021.9.0. I’m still not 100% sure what dependency was missing but there was a call to a COM object inside Visual Studio that is only registered with certain things. The call was unnecessary and removing it prevents this error from happening and PoshTools will correctly install the proper pre-reqs during installation if they aren’t already there.

Hey @typod,

I did. If you would like to try out the pre-release build for this issue, you can download it here: Dropbox - PowerShellTools.2021.9.0.vsix - Simplify your life

The extension now properly enforces pre-reqs and shouldn’t encounter this error. This will be part of the september release.

Fantastic. Thanks Adam. I will give it a blast.