Skip to content

Do not attempt to set breakpoints on files extensions other than .ps1 or .psm1 #574

Closed
@rkeithhill

Description

@rkeithhill

Got this while trying to debug a PS script in the PowerShell repo where I had previously been debugging some C# code. So I had a mix of .cs and .ps1 breakpoints. I noticed this in my log file:

11/4/2017 1:10:59 PM [VERBOSE] - Method "ExecuteCommand" at line 491 of C:\projects\powershelleditorservices\src\PowerShellEditorServices\Session\PowerShellContext.cs

    Attempting to execute command(s):
    
        Microsoft.PowerShell.Utility\Set-PSBreakpoint
    

11/4/2017 1:10:59 PM [VERBOSE] - Method "OnSessionStateChanged" at line 1138 of C:\projects\powershelleditorservices\src\PowerShellEditorServices\Session\PowerShellContext.cs

    Session state changed --
    
        Old state: Running
        New state: Ready
        Result: Completed

11/4/2017 1:10:59 PM [ERROR] - Method "ExecuteCommand" at line 545 of C:\projects\powershelleditorservices\src\PowerShellEditorServices\Session\PowerShellContext.cs

    Execution completed with errors:
    
    A parameter cannot be found that matches parameter name 'StringBuilder'.
    A parameter cannot be found that matches parameter name 'StringBuilder'.
    A parameter cannot be found that matches parameter name 'StringBuilder'.
    A parameter cannot be found that matches parameter name 'StringBuilder'.
    Cannot set breakpoint on file 'C:\Users\Keith\GitHub\rkeithhill\PowerShell\src\System.Management.Automation\engine\parser\tokenizer.cs'; only *.ps1 and *.psm1 files are valid.
    A parameter cannot be found that matches parameter name 'StringBuilder'.
    

11/4/2017 1:10:59 PM [VERBOSE] - Method "OnSessionStateChanged" at line 1138 of C:\projects\powershelleditorservices\src\PowerShellEditorServices\Session\PowerShellContext.cs

Seems pretty obvious that we shouldn't bother to set PowerShell breakpoints on these other file types.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions