I’m using the guide “.NET Core Development and Debugging on Torizon Using Visual Studio Code” on the Toradex website. I do have some questions:
1: “Copy content of the template folder in this repository to the .vscode subfolder of your project,…”
Can’t compute. I have no idea which template folder and where it is?
The created project has none of the above folders. The VS Code did install of the “C# support for Visual Studio Code” by itself and is shown as installed extensions.
2: Get the IP of the target device
My device is connected to the company network. I have no idea of the assigned IP for my device.
So it may be nice to show the IP somewere on the login screen?
Yes, this did help clearify it. But where must the dot-net-core repositoty be copied to? I guess the stuff inside the ‘containers’ must be needed when building the containers?
Yes repository should be cloned in your Visual Studio Code project folder such that the file paths in /template work. You could also modify the default file paths in /template if you so wish.
As for the error, I believe this is an issue with your default shell. The && syntax seems to be valid in command prompt but not powershell. The following article describes how to change what shell these commands get run in: Integrated Terminal in Visual Studio Code
I dont know if we have an unusal restrictive network setup. I guess it is not different than other big companies. But it is not something I can change.
Adding a proxy may work. I dont know how it is done and I guess if I ask IT they say it is not allowed. I probally dont have the priviliges to do so anyway.
So i guess Im stuck and the Torizon/.NET Core seems to be a dead end.
Have you gone through the getting started guide for Torizon? Just curious as there are steps there that have you setup Docker on your PC and pull some basic containers.
It’d be valuable to know if your environment can pull from the Docker Hub registry but not from Microsoft’s registry.
I just tried the get starting guide.
I tried on my PC and on the Torizon. It seems I’m not allowed to get the containers from docker…
On PC:
T:>docker pull hello-world
Using default tag: latest
Error response from daemon: Get https://registry-1.docker.io/v2/: dial tcp 34.197.189.129:443: connect: connection refused
On Torizon SSH
Last login: Thu Jan 1 00:00:33 1970
colibri-imx6-05175073:~$ docker run hello-world
Unable to find image ‘hello-world:latest’ locally
docker: Error response from daemon: Get https://registry-1.docker.io/v2/: dial tcp 52.201.142.14:443: connect: connection refused.
See ‘docker run --help’.
colibri-imx6-05175073:~$ ^C
colibri-imx6-05175073:~$
I don’t see an easy way around this if your network doesn’t have access to standard Docker registries. As TorizonCore by design is centered around the usage of containers.
I manage to get a direct line to the ouside world (After arm wrestling with IT) . And manage to get the files for docker.
I got the builddebugcontainer and deploydebugcontainer to run…
Final part is to debug it.
I need some package to do this ( Like “Microsoft.NETCore.App.Runtime.linux-arm”). But where to install the .NET Core files? In the WSL?
Microsoft (R) Build Engine version 16.4.0+e901037fe for .NET Core
Copyright (C) Microsoft Corporation. All rights reserved.
Restore completed in 124,46 ms for C:\work\NETCore\mytestapp\mytestapp.csproj.
mytestapp → C:\work\NETCore\mytestapp\bin\Debug\netcoreapp3.1\mytestapp.dll
Build succeeded.
0 Warning(s)
0 Error(s)
Time Elapsed 00:00:01.21
Terminal will be reused by tasks, press any key to close it.
Microsoft (R) Build Engine version 16.4.0+e901037fe for .NET Core
Copyright (C) Microsoft Corporation. All rights reserved.
C:\work\NETCore\mytestapp\mytestapp.csproj : error NU1101: Unable to find package Microsoft.NETCore.App.Runtime.linux-arm. No packages exist with this id in source(s): Microsoft Visual Studio Offline Packages
C:\work\NETCore\mytestapp\mytestapp.csproj : error NU1101: Unable to find package Microsoft.AspNetCore.App.Runtime.linux-arm. No packages exist with this id in source(s): Microsoft Visual Studio Offline Packages
C:\work\NETCore\mytestapp\mytestapp.csproj : error NU1101: Unable to find package Microsoft.NETCore.App.Host.linux-arm. No packages exist with this id in source(s): Microsoft Visual Studio Offline Packages
Restore failed in 186,41 ms for C:\work\NETCore\mytestapp\mytestapp.csproj.
The terminal process terminated with exit code: 1
Terminal will be reused by tasks, press any key to close it.
I see, based on the error message it would seem like you would need to add this package to your .NET project itself as that is where the debug process is looking.
Install-Package : No match was found for the specified search criteria and package name ‘runtime.linux-arm.Microsoft.NETCore.App’. Try Get-PackageSource to see all available registered package sources
I have now used weeks and still not been able to run a “Hallo World” on the Torizon device.!!
I have followed the on-line guides and done stuff not in the guides. Maybe the guides are imcomplete? Maybe it works great on other machine? Maybe it works like a charme when using Linux, but I dont?
Maybe It is because I dont know how Visual Studio Code and WLS works in detail?
I have done .NET and C# development for many years from Visual Studio 2003 to 2017. From .NET 2.0 to 4.7. So I know Visual Studio and .NET.
If I connect a Windows IoT Core device to my PC, I create a project in Visual Studio, build and run it on the device. No command line, no fiddling around with coping files, no installation of different packages, That is ease of use.
Maybe I just wait for the Visual Studio Integration is finished with .NET support to try it out. Any idea when that is scheduled?
Apologies for the issues, this case has been elevated to our development team who are working on sorting the issues out with the IDE intergration. Thank you for reporting these issues however as your feedback is important.
In truth the windows integration stuff hasn’t been iterated/tested upon as much as it should have.
At the moment I can not give a definite timeline on when the extension will be fixed. But I will update this thread when I get any more information
Did you install the .NET SDK on your machine? The files require on the client are already in the container, including the debugger.
You should also build your app without boundling the runtime. The runtime is part of the container and leaving it out of the application will allow the system to load the runtime libs only once if you run multiple applications.
Boundling the runtime is useful if you need to ship your application to run on different environments, but with containers you have full control of the environment, so this is not giving a real advantage.
We are working on a better integration, made with an extension and not just scripts. This will be an official release, we don’t have an exact date yet, but development is almost complete.