#VSCode – Build and Run C# #DotNetCore projects in #RaspberryPi


Time to move on with some lessons learned using Visual Studio Code in the Raspberry Pi 4.

One of the first issues you may find working with VSCode in the device is related to file write permissions when you are saving a file.

I raspberry pi 4 visual studio code failed to save file

So, it was a good opportunity for me to learn about files and folder permissions in Linux. I found a great starting article “How to Manage File and Folder Permissions in Linux” (see references), and it allowed me to fix this issue.

My next error was triggered when I try to build my project. Again, it was a permission related error.

error MSB3021: Unable to copy file "obj/Debug/netcoreapp2.2/dotnethelloworld.dll"
to "bin/Debug/netcoreapp2.2/dotnethelloworld.dll". Access to the path
is denied. [/home/pi/dotnethelloworld/dotnethelloworld.csproj]

However, this time the fix was not related to file and folder permissions.

One of the solutions I found, was to run VSCode with admin privileges. This is probably one of the worst ideas ever, and you can find tons of articles explaining why this is bad (see references).

Anyways, I decided to give it a try. Of course, it worked. Let me share how.

I run VSCode with the following command, which runs the app in root mode.

code-oss --user-data-dir=/home/pi/dotnethelloworld
raspberry pi 4 visual studio code run as root

The VSCode team is aware of this, so you will find a warning about this scenario

raspberry pi 4 visual studio code run as root warning

Even so, you can still use VSCode to edit and build C# .Net Core Projects.

raspberry pi 4 visual studio code build code

And you can run them also

raspberry pi 4 visual studio code build and run edited code

So far, so good. Or maybe not, broken a lot of good practices. I’ll see this as an amazing chance to learn and test new stuff!

Happy coding.

Greetings @ Burlington

El Bruno



#RaspberryPi – How to install #DotNetCore in a #RaspberryPi4 and test with #HelloWorld (of course!)


During the next couple of months, I’ll be sharing some amazing experiences around AI. Some of these experiences includes IoT devices like a Raspberry Pi, and of course some Machine Learning.Net (ML.Net). Because ML.Net is built with .Net Core, it makes sense to share the 5 simple steps you need to do to install .Net Core in a Raspberry Pi.

Of course, my 1st try was to navigate to the official .Net page (see references), which automatically detect my Linux distro and proposes a set of x64 SDKs.

raspberry pi 4 .net tutorial page with linux distribution options

I’m completely sure that I’m working in a 32 bits environment, however I’ll double check this with the following commands

sudo apt-get install lshw

After installing lshw I confirm that I’m in a 32 bit environment

raspberry pi 4 lshw information on 32 bit environment

Bonus: lshw is a small tool to extract detailed information on the hardware configuration of the machine. It can report exact memory configuration, firmware version, mainboard configuration, CPU version and speed, cache configuration, bus speed, etc. on DMI-capable x86 or IA-64 systems and on some PowerPC machines (PowerMac G4 is known to work).

Now I need to navigate to the download page to download the specific Linux 32-bit version (see references).

Once I got the image downloaded its time to extract the file on a specific folder. I’ve created a folder named “dotnet” with the following command

sudo mkdir -p dotnet

And to extract the image from the Downloads folder

sudo tar zxf dotnet-sdk-2.2.401-linux-arm.tar.gz -C

Let’s create a symbolic link to the extracted binaries

sudo ln -s /home/pi/dotnet/dotnet /usr/local/bin

And it’s done! Let’s invoke the .DotNet help command to test it

raspberry pi 4 .net core 2.2 installed and test dotnet help

Now we can follow the steps of [.NET Core on Raspberry Pi, see references] to create a Console Application and to test the device.

To create a new console App

dotnet new console
raspberry pi 4 .net core 2.2 create new console app

And test the app

sudo dotnet run
raspberry pi 4 .net core 2.2 console app run

We can publish the app for linux / raspberry pi

sudo dotnet publish -r linux-arm

And copy the generated folder to be used in another device

raspberry pi 4 .net core 2.2 console app build and publish folder to reuse

So next steps will be some other tests with Raspberry Pi and .Net Core. And the following image is a big teaser of this

raspberry pi 4 .net core 2.2 console app edit in Visual Studio Code

Happy coding!

Greetings @ Toronto

El Bruno


#VS2017 – Visual Studio 2017 Update 3 released: .Net Core 2.0, #AzureFunctions and more

Hello !

Now that we only have a version of Visual Studio 2017, every time an update of the big ones appears, it’s time to slow down and see what new features are there. In the case of Visual Studio 2017 15.3, IMHO the 2 biggest new features are

  • .Net Core 2.0, I suppose I will have to organize a theme update with JuanLu for another episode of the podcast (link)
  • Azure Functions, which are the subject that I will write about today and about what we talked about a while ago in the podcast with David and Pedro (link)

The idea and implementation of Azure Functions is something really really cool. Surely I will find a Hater and he will tells me that “this is not 100% Serverless, someone is keeping the server somewhere“, but I take this type of comments and put them in places where I rarely get some sun.

I very much value having the possibility of creating an operation and just devoting time to programming the business logic and to deploy it. That saves me time, a lot of time that I do not have to dedicate in creating a project to support the infrastructure of it.


Note: the animation is from the original post on Visual Studio 2017 15.3.

Well, until today we could use Azure Functions by programming them directly in the web editor from Azure or with an extension for VS2017. Using Visual Studio 2017 to create Azure Functions gave us some advantages such as the ability to debug them locally, add NuGet packages, create unit tests, deploy to Azure from the IDE, and more.

I have hit a surprise of good, when after updating to VS217 15.3, I found that the IDE did not recognize me more this type of projects. It turns out that now that Azure Functions are part of the Visual Studio 2017 core, so you have to install the Azure Development Workload, to have them. SO it was time to launch our beloved Visual Studio 2017 Installer


Select the “Azure Develpment” option


2 clicks later I can create a new Azure Functions project

I3 Then I can add the class for the function


And that’s pretty much it!


Happy Coding!

Greetings @ Mississauga

El Bruno


#VS2017 – Update 3, .Net Core 2.0 y #AzureFunctions

Hola !

Ahora que solo tenemos una version de Visual Studio 2017, cada vez que aparece un update de los grandes, es momento de frenar y ver que novedades trae el mismo. En el caso de Visual Studio 2017 15.3, IMHO las 2 novedades más grandes son

  • .Net Core 2.0, supongo que tendre que organizar un Update del tema con JuanLu para otro episodio del podcast (link)
  • Azure Functions, que son el tema sobre el que escribiré hoy y sobre lo que hablamos también hace un tiempo en el podcast con David y Pedro (link)

La idea e implementación de Azure Functions es algo que realmente está muy bien, pero muy bien. Seguramente no faltara un Hater que me diga que “eso no es 100% Serverless, alguien está manteniendo el server en algún lado”, pero a mi sinceramente este tipo de opiniones me pasan por sitios donde pocas veces me ha dado el sol.

Yo valoro mucho tener la posibilidad de poder crear una operación y solo dedicar tiempo a programar la lógica de negocios y a desplegar la misma. Eso me ahorra tiempo, mucho tiempo que no tengo que dedicar en crear un proyecto para soportar la infraestructura del mismo.


Nota: la animación es de post original de Visua Studio 2017 15.3.

Pues bien, hasta la fecha podíamos crear Azure Functions programando las mismas directamente en el editor web desde Azure o con una extensión para VS2017. Utilizar Visual Studio 2017 para crear Azure Functions nos daba algunas ventajas como la capacidad de depurarlas localmente, agregar paquetes NuGet, crear pruebas unitarias, desplegar a Azure desde el IDE, y más.

Yo me he pegado una sorpresa de las buenas, cuando después de actualizar a VS217 15.3, me encontré que el IDE no me reconocía mas este tipo de proyectos. Resulta que ahora que las AF son parte del core de VS2017, hay que instalar el Workload de Azure Development. Para esto tenemos que lanzar el instalador de Visual Studio 2017


Y seleccionar la opción “Azure Develpment”


2 Clicks después ya puedo crear un proyecto del tipo Azure Functions


Luego agregar una clase para la función


Y comenzar a programar


Por cierto, alguien me ha dejado el testigo de utilizar AF desde un proyecto Hololens, así que algo posteare en cuanto tenga tiempo.

Happy Coding!

Saludos @ Mississauga

El Bruno


#Podcast – NTN 32 – .Net Core and some experiences using Dev tools in the real world

giphy (1)

Hi !

Today I have the placer to speak again with Juan Luis Guerrero (@JuanLuElGuerre), and this time he will share with us some of his experiences in a new adventure in Sevilla. This new adventure is cool to share because he is using a lot of cool new technologies, and he moved on from the “Hello World” stage a long time ago. So, JuanLu will share with us some of his experiences using, configuring, deploying, and testing .NET Core in different environments like Windows Core, Linux and more.

We will also speak about other products and tools like Sonar, XUnit instead of MSTest, Test Manager, Linux and Docker, and more.

I hope you enjoy the SPANISH episode. Podcast Link

Greetings @ Burlington

El Bruno