.net core 在Raspberry Pi 4上从visual studio 2019 CE进行Dotnetcore 3.0远程调试-权限不足
如果有人能告诉我如何在raspberry pi 4上从visual studio 2019 CE远程调试dotnetcore 3.0控制台应用程序,我会更高兴.net core 在Raspberry Pi 4上从visual studio 2019 CE进行Dotnetcore 3.0远程调试-权限不足,.net-core,raspberry-pi,.net Core,Raspberry Pi,如果有人能告诉我如何在raspberry pi 4上从visual studio 2019 CE远程调试dotnetcore 3.0控制台应用程序,我会更高兴 plink-ssh-pw树莓pi@raspberrypi.local“curl-sSLhttps://aka.ms/getvsdbgsh |bash/dev/stdin-r linux arm-v latest-l~/vsdbg“ 已安装并在PI上运行 using Iot.Device.CpuTemperature; using Syst
plink-ssh-pw树莓pi@raspberrypi.local“curl-sSLhttps://aka.ms/getvsdbgsh |bash/dev/stdin-r linux arm-v latest-l~/vsdbg“
已安装并在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);
}
}
}
}
编译时没有错误。下面是一些错误行为的屏幕截图:
(德语翻译)连接到进程时出错:.net调试器(vsdbg)没有足够的权限调试进程。为了调试进程,“vsdbg”必须使用root权限执行。您可以在Visual Studio中通过SSH进行调试 因此,您要做的是:
- 制作你的hello world应用程序
- 在需要断点的地方设置断点
- 在调试中构建应用程序,自包含
- 将应用程序部署到Rapberry Pi(它必须在Pi上启用SSH,运行类似Raspbian的东西)
- 通过SSH将调试器从VS2019连接到Pi
我忘了提到应用程序实际上在PI上工作。我在MSDN论坛上发布了相同的问题:这似乎是越野调试:谢谢,这帮了大忙。我添加了使用WinSCP和一个环境变量来简化工作。谢谢,这真的很有帮助。