Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. .NET (Core and Framework)
  4. Remote debugging on Raspberry Pi in Visual Studio Code.

Remote debugging on Raspberry Pi in Visual Studio Code.

Scheduled Pinned Locked Moved .NET (Core and Framework)
csharpvisual-studiolinuxhardwaredebugging
3 Posts 3 Posters 5 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • J Offline
    J Offline
    Jerry Walter 2024
    wrote on last edited by
    #1

    I have a Raspberry PI (Linux-arm) with sense sense hat, being accessed on Windows 11 via ssh. The source code is on the Raspberry pi and I have the Visual Studio Code (latest) loaded on the Windows 11 machine. I have the remote SSH and remote SSH editing extensions loaded in VS. The version of dotnet on the Pi is .NET SDK: Version: 7.0.100 Commit: e12b7af219 Runtime Environment: OS Name: raspbian OS Version: 11 OS Platform: Linux RID: linux-arm Base Path: /home/pi/.dotnet/sdk/7.0.100/ Host: Version: 7.0.0 Architecture: arm Commit: d099f075e4 .NET SDKs installed: 7.0.100 [/home/pi/.dotnet/sdk] .NET runtimes installed: Microsoft.AspNetCore.App 7.0.0 [/home/pi/.dotnet/shared/Microsoft.AspNetCore.App] Microsoft.NETCore.App 7.0.0 [/home/pi/.dotnet/shared/Microsoft.NETCore.App] I can build and run the application on the Raspberry PI, with no problems. The part I am missing is to be able to debug the application remotely. I have gone through a few examples on the net, but nothing seems to be helpfull. Any suggestions ? Thanks

    J 1 Reply Last reply
    0
    • J Jerry Walter 2024

      I have a Raspberry PI (Linux-arm) with sense sense hat, being accessed on Windows 11 via ssh. The source code is on the Raspberry pi and I have the Visual Studio Code (latest) loaded on the Windows 11 machine. I have the remote SSH and remote SSH editing extensions loaded in VS. The version of dotnet on the Pi is .NET SDK: Version: 7.0.100 Commit: e12b7af219 Runtime Environment: OS Name: raspbian OS Version: 11 OS Platform: Linux RID: linux-arm Base Path: /home/pi/.dotnet/sdk/7.0.100/ Host: Version: 7.0.0 Architecture: arm Commit: d099f075e4 .NET SDKs installed: 7.0.100 [/home/pi/.dotnet/sdk] .NET runtimes installed: Microsoft.AspNetCore.App 7.0.0 [/home/pi/.dotnet/shared/Microsoft.AspNetCore.App] Microsoft.NETCore.App 7.0.0 [/home/pi/.dotnet/shared/Microsoft.NETCore.App] I can build and run the application on the Raspberry PI, with no problems. The part I am missing is to be able to debug the application remotely. I have gone through a few examples on the net, but nothing seems to be helpfull. Any suggestions ? Thanks

      J Offline
      J Offline
      jschell
      wrote on last edited by
      #2

      Jerry Walter 2024 wrote:

      Any suggestions ?

      To start with explain exactly what the following means. "The part I am missing is to be able to debug the application remotely." So do you mean that when you attempt to attach the debugger remotely it fails to connect? Or it connects but doesn't step? Or you don't know how to connect? Or when connecting there is an error? Or perhaps even you are not even running the binary on the PI but are attempting to simulate it on a regular desktop? And there are potentially other variations.

      F 1 Reply Last reply
      0
      • J jschell

        Jerry Walter 2024 wrote:

        Any suggestions ?

        To start with explain exactly what the following means. "The part I am missing is to be able to debug the application remotely." So do you mean that when you attempt to attach the debugger remotely it fails to connect? Or it connects but doesn't step? Or you don't know how to connect? Or when connecting there is an error? Or perhaps even you are not even running the binary on the PI but are attempting to simulate it on a regular desktop? And there are potentially other variations.

        F Offline
        F Offline
        fds site xyz
        wrote on last edited by
        #3

        To successfully debug the application remotely, follow these steps: Check Network Connectivity: Ensure both the debugging machine and the target device (such as a Raspberry Pi) are connected to the same network and can communicate with each other. Setup Remote Debugging Environment: Depending on the development environment and tools used, configure the IDE or debugger to enable remote debugging. This typically involves specifying the IP address or hostname of the target device and the port for debugging. Verify Debugging Permissions: Ensure that the debugging user has appropriate permissions to access the target device remotely. This might involve setting up SSH keys or configuring user permissions on the target device. Troubleshoot Connection Issues: If the debugger fails to connect remotely, check for firewall settings, network configurations, and any other potential barriers to communication between the debugging machine and the target device. Test Step-by-Step Execution: Once the debugger successfully connects, test step-by-step execution to ensure that you can pause, resume, and inspect the application's execution remotely. Handle Errors and Exceptions: If you encounter errors or exceptions during remote debugging, diagnose them as you would with local debugging. Pay attention to any differences in behavior between remote and local debugging environments. Optimize Performance: Depending on the network conditions and the complexity of the application, optimize the debugging setup for performance. This might involve adjusting debugger settings or optimizing the application code itself. Document Remote Debugging Procedure: Document the remote debugging procedure for future reference, including any specific configurations or troubleshooting steps required. By following these steps, you should be able to debug the application remotely and efficiently troubleshoot any issues that arise during the debugging process.

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups