question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

VS code debugging issue for azure powershell function - Omnisharp Json Rpc exception

See original GitHub issue

Environment data

VS Code version: 1.68.0 C# Extension version: 1.25.0 Azure Core tools: v4 powershell version: 7

OmniSharp error

image

Steps to reproduce

  1. Create azure powershell function
  2. Put a breakpoint anywhere and hit F5
  3. See error

Expected behavior

Should be able to debug the function

Actual behavior

Exception of type Omnisharp.Extensions.JsonRpc.RpcErrorException was thrown

Issue Analytics

  • State:open
  • Created a year ago
  • Reactions:3
  • Comments:7 (2 by maintainers)

github_iconTop GitHub Comments

4reactions
HariKrishna598commented, Jun 16, 2022

We have tried the scenarios like

  • Uninstalling and Re-installing the C# version in VS Code Extensions
  • changing the C# version in VS Code Extensions
  • Restarting the VS Code

But getting the same exception for us too. Please give us a fix to this issue!

0reactions
tanieee28commented, Oct 14, 2022

I landed here by searching for possible solutions to the main problem “Omnisharp Json Rpc exception” occuring in VS Code. I tried everything possibly written here but could not get the resolution. I spent complete day in hope to resolve this and finally could do it. Here are the steps that helped me:

-prerequisites:

  1. launch.json
  2. tasks.json
  • configure launch.json { “name”: “Attach to PowerShell Functions”, “type”: “PowerShell”, “request”: “attach”, “customPipeName”: “AzureFunctionsPSWorker”, “runspaceId”: 1, “processId”: “${command:azureFunctions.pickProcess}”, “preLaunchTask”: “func start” //This should match with next tasks.json label }

  • configure tasks.json

{ “label”: “func start”, “type”: “shell”, “command”: “func start”, “problemMatcher”: “$func-powershell-watch”, “isBackground”: true }

Hope it helps for someone facing the same problem.

Credit to -> https://stackoverflow.com/questions/67119522/how-to-start-azure-function-locally-and-attach-debugger-to-process-dynamically-v

Read more comments on GitHub >

github_iconTop Results From Across the Web

Omnisharp Json Rpc exception · Issue #3076 · Azure ... - GitHub
Function running successfully but debugger not hitting and that the OmniSharp Json Rpc exception dialogue box pops up - this is happening only ......
Read more >
VS code powershell azure function debugging omnisharp ...
Show activity on this post. I have tried with different scenarios, but debugging didn't work: Tried by changing the C# version in VS...
Read more >
Microsoft's PowerShell Dev Team Helps Fix OmniSharp
The VS Code PowerShell extension uses the OmniSharp LSP library and Debug Adapter Protocol (DAP) server library, said to be the tool's ...
Read more >
Working with PowerShell Azure Functions locally
This article is intended to guide you on how to work with PowerShell Azure Functions in your local machine.
Read more >
Create a PowerShell function in Azure using Visual Studio Code
To start the function locally, press F5 or the Run and Debug icon in the left-hand side Activity bar.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found