howto develop c# on raspbian and vs 2019

Frank Sarlemijn 21 Reputation points
2021-01-14T11:29:24.053+00:00

I would like to write a simple file transfering app on a SBC. I have chosen raspberry pi for this. Windows IoT proved to be unreliable and I gather from the web that Microsoft stopped the development of this in favor of using Linux (in this case raspbian) as OS. Correct so far? Visual Studio can crosscompile for ARM processers and it can do remote debugging. I am having trouble getting to remote debug an app on the raspberry pi. Setting authentication mode to 'universal' in VS gets a dialog asking for a PIN number, setting the authentication mode to 'none' tells me that msvsmon.exe is not running on the remote computer. My last development experience is 10 years ago, I need some pointers to get these modern developments working, thank you!

Developer technologies | Visual Studio | Debugging
Developer technologies | Visual Studio | Setup
Developer technologies | .NET | .NET Internet of things
{count} votes

Accepted answer
  1. David Lowndes 4,726 Reputation points
    2021-01-14T20:03:11.18+00:00

    Using the instructions here worked for me.

    I created a .NET Core console project using the latest VS 2019, changed its project settings to be .NET Core 5 (it's created as 3.1).

    On the Pi (a 3B which already had the prerequisites installed to have an SSH connection), I downloaded .NET Core 5, followed the installation instructions on that page and checked that dotnet ran.

    I copied over the built .net5.0 project binaries from Windows to my Pi using WinSCP.

    Using the Pi, I determined that the console DLL could be run by dotnet MyCodeName.dll.

    While the code is running (I'd stuck a Console.ReadKey() line in), I could attach with the VS debugger using the instructions given.

    It's a slight faff compared to the relatively seamless experience of native code, but it worked.


0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.