Skip to content

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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
rkeithhill opened this issue Nov 5, 2017 · 0 comments
Assignees
Labels
Issue-Bug A bug to squash.
Milestone

Comments

@rkeithhill
Copy link
Contributor

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.

@rkeithhill rkeithhill self-assigned this Nov 5, 2017
@rkeithhill rkeithhill added this to the 1.5.1 milestone Nov 6, 2017
@rkeithhill rkeithhill added the Issue-Bug A bug to squash. label Nov 6, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Issue-Bug A bug to squash.
Projects
None yet
Development

No branches or pull requests

1 participant