Reputation: 13
If there was anyone who could tell me how to remote debug a dotnetcore 3.0 console app from visual studio 2019 CE on a raspberry pi 4, I'd be happier.
plink -ssh -pw raspberry [email protected] "curl -sSL https://aka.ms/getvsdbgsh | bash /dev/stdin -r linux-arm -v latest -l ~/vsdbg"
is installed and runs on the PI
using Iot.Device.CpuTemperature;
using System;
using System.Device.Gpio;
using System.Threading;
namespace Raspi
{
class Program
{
static void Main(string[] args)
{
CpuTemperature temp = new CpuTemperature();
GpioController ctrl = new GpioController();
int pin = 4;
int wait = 5000;
ctrl.OpenPin(pin, PinMode.Output);
Console.WriteLine("Hello World!");
int counter = 0;
while (true)
{
Console.WriteLine($"The CPU temperature is {temp.Temperature.Celsius}");
Console.WriteLine("counter=" + counter++);
ctrl.Write(pin, PinValue.High);
Thread.Sleep(wait);
ctrl.Write(pin, PinValue.Low);
Thread.Sleep(wait);
}
}
}
}
Compiles without errors. Here some screenshots of the error behaviour:
vsbdg runs under root account
vsdbg can be found while browsing via ssh
And this error comes up
(translated from German) Error while connecting to the process: The .net debugger (vsdbg) doesn't have sufficient rights to debug the process. In order to debug the process, 'vsdbg' must be executed using root rights.
Upvotes: 1
Views: 1734
Reputation: 1065
You can debug over SSH in Visual Studio.
So what you want to do is effectively this:
I wrote a longer article explaining exactly what I did here. It's the friend link so you don't get hit with Medium's paywall. It also means we're friends now.
Upvotes: 2