Publishing issue to the Pi
Hi @gloveboxes
I am following your example as shown on
https://github.com/gloveboxes/Create-RaspberryPi-dotNET-Core-C-Sharp-IoT-Applications/blob/master/labs/Lab_1_Build_dot_NET_Core_app/README.md
I am having difficulty clarifying if my steps are correct. This is the error I am getting.
* The terminal process "C:\WINDOWS\System32\WindowsPowerShell\v1.0\potained -c Debug -o ./bin/linux-arm/publish ./dotnet.core.iot.csharp.cspnet.core.iot.csharp"" terminated with exit code: 1.
* Terminal will be reused by tasks, press any key to close it.
* Executing task: sh -c "dotnet publish -r linux-arm --self-containedroj && rsync -rvuz ./bin/linux-arm/publish/ djosh@raspberrypi:~/dotnet.
At line:1 char:122
+ ... -o ./bin/linux-arm/publish ./dotnet.core.iot.csharp.csproj && rsy
+ ~~
The token '&&' is not a valid statement separator in this version.
+ CategoryInfo : ParserError: (:) [], ParentContainsErrorR
+ FullyQualifiedErrorId : InvalidEndOfLine
* The terminal process "C:\WINDOWS\System32\WindowsPowerShell\v1.0\potained -c Release -o ./bin/linux-arm/publish ./dotnet.core.iot.csharp.cotnet.core.iot.csharp"" terminated with exit code: 1.
* Terminal will be reused by tasks, press any key to close it.
I have Windows 10 PC and have already got .net6 installed. Therefore do I need to reinstall it via WSL again?
What could be wrong?
Should "usr" also need to be changed
"pipeProgram": "/usr/bin/ssh",
Hi there, you have to run in the context of wsl2 on windows. It uses Linux utilities to sync code... cheers Dave
Thank You @gloveboxes for your reply. I am fairly new to Linux.
So how do I run this in the context of wsl2 on windows?
Is there any video tutorial to take me through the process?
Hi, the docs do step you through using wsl on windows. If your new to wsl, search YouTube, there are a lot of videos that intro wsl. Cheers Dave
@gloveboxes Thanks, i will check it out
Is this the simplest setup for programming for raspberry pi when using c#?
We aim to interface with USB will .net handle both Windows and Unix drivers?
Hi from all the research I did, this is the easiest way on windows. I've not tried usb but I see no reason why you can't call out to a Linux usb driver...
Thanks, @gloveboxes
So if I have understood it correctly, with WSL or WSL2, it would be as if I am running/coding on a Linux OS. Then with the VSC extension, it would be as if VSC code is running on Linux even though it's installed on Windows.
I hope I am correct
Yup, spot on.
@gloveboxes, Thank You for your help.
Few last questions before I close for the day(located in UK) .. The tutorial you refer to is "command prompt." is that the Windows CMD prompt when you type "cmd" or Linux when you type "WSL" in the search bar?
And you also mention installing .net core. My PC has already got .net, so I am presuming this installation is for the Linux environment.
Hi, yes, and windows command prompt, cmd or powerful and then launch wsl. Then install .net in wsl.
@gloveboxes Does it make a difference what Rasberrypi used? I am using the Zero 2W. As the task and launch refer to ARM32 or ARM64, I am correct Zero 2W is based on a different arm,
I'm pretty sure that chip can run both raspberry pi os 32 and 64 bit. So select the arm architecture that matches the os you installed on the raspberry Pi.
@gloveboxes Thanks I will check that out again,
I will try that tomorrow.
It seems I am able to transfer the code to the pi, but then the pi hangs after starting .net debugger and all I see is:
Starting: "/usr/bin/ssh" djosh@raspberrypi "~/vsdbg/vsdbg --interpreter=vscode"