Installing the .NET Core SDK on the Raspberry Pi

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
I'm here at home working on some personal projects and this is during the 2020 shelter at home director of that pretty much is happening around the world well some of the projects I don't want to work on involve the dotnet core framework now I plan to run these on a Raspberry Pi an obvious solution for doing this is to install Windows IOT core and a Raspberry Pi and use dotnet core from there but that actually isn't necessary you can keep Linux on your Raspberry Pi and still run the Installer on dotnet core applications so in this video I'm just going to go through these steps of getting dotnet core installed on a Raspberry Pi and I already try this out in my Raspberry Pi 3 within this video I'm going through the steps of installing it on I'm sorry I've already installed on my 4 in this video I'm going through the steps of installing it on the 3 which are identical yeah just one other thing you're probably gonna hear some background noise you might hear a dog bark my ear lawnmower go on right now with everyone being at home I have found that there's not really any way that I can find a truly quiet environment so that's just going into being part of the video Here I am I'm on my computer I want to do everything over at this age it's just easier for me so I'm starting off on doing this for my Mac I need to get the URL to the installation for the particular version of the.net core runtime that I'm going to install I can do that by going to net Microsoft calm when you get there on a landing page there's an obvious download button and we want to see all of the dotnet core downloads the most recent recent version is the dotnet core 3.1 runtime we get to this page you can see that they have a number of different downloads and different CPU architectures for now the only thing that we need is the SDK itself which has the runtime within it on another video I'm going to come back and I'm going to take a look at that ASP core runtime because I also have some interest here but under the SDK I'm doing some Raspberry Pi which is running Linux and like if you have the Raspberry Pi for yes that's a 64-bit processor but if you're running run raspbian that's still a 32-bit operating system so you need to use the 32-bit version of the tools there do exist 64-bit Linux images for the Raspberry Pi on which you use a 64-bit arms image we're using a standard raspbian image you can't use 64-bit yet if I click on this you can see it tries to download but I'm not interested in downloading it directly I just want to get the URL so copying that and now I'm gonna SSH into my device okay so I'm connecting to my device see password okay I'm connected now I've got to make some decisions about when wearing download things and where I'm going to install it and I'm just gonna use a downloads folder for holding this actually you make just keep things cleaner let me make a dotnet subdirectory so they're not a download I have the URL so I can download by using the W git command and just providing it with the URL that I copied earlier there's always downloading and since I'm connected to the PI this is downloading on to the PI's drive okay the download is there the next thing I need to do is to unpackage it now I already know where I wanted to get it in package I need to make a folder for this so in the US are its from the root US are there is a subfolder called share not only put dotnet within there and the reason oops Scott I need to use sudo in order to do this and the reason I'm putting it in this location is I did notice that some software will automatically look at that location for the default location for the framework now if you use a different location if you just I to use a different location that's fine with this episode I'm following this is gonna work at any location yes see if I type my command correctly mkdir okay we have a location so I need to use the tar command package this OC with the arguments exf and then it just needs the name of the file okay so there's the file followed by C and then I need the location of which I want everything in package so that what CMS us our share and animator support or net and of course once again I've made a mistake let's do this as you can the mistake that I made is its impact to that folder I need to go ahead and do this under Seto now there's sunset let's go to the location and take a look at what's there they're looking at this folder the thing that's most important is you see there's an executable they're called dotnet if we run it just to make sure it works okay cool so it works if you use the dotnet core one time before then you are familiar with this executable you end up using it a lot but right now the issue is that in order to use it I either need to type the complete path for change to that folder and that's just not gonna work for our purposes like here from my home directory if I type net command not found there's a few way that we can go about fixing this one now I'm going to use is I am going to make an update to the dot profiles file PR oops Nano okay so in dot profile there's re gonna be some stuff there which is fine we ignore most of us there we just need to add a few things we're going to update the path environment variable so that it keeps whatever I had in it before but then it also needs to have you see us our share net I'm also adding the path to that specific folder or to our path environment variable now I'm also going to make a new environment variable it's going to be called dotnet root and some tools we'll take a look at this whenever it's looking for the dotnet core runtime and it's going to be set equal to that same folder and so that's all that I need so let's go ahead and save this exit and so that it takes effect I'm going to reboot can we can I come back to my pie let's make sure that dotnet is visible and I also do tea and et and it's there and I didn't have to change folder so next up let's make a project and this project is e as you can see it's gonna be called hello world and it will do exactly what you think it will do there's nothing in here right now since just created this folder creating the project use dotnet new console because I want to create a new console project and it'll do its thing and take care of creating a new project for me ok the new projects created so let's see what's in this folder now we see the source file actually clear this and do this again here we see there's a source file there's a project file I'm not worried about the obj let's take a look at what's inside the source file and there it is hello world just to make a small change to it hello world from j2i any key they'll see this exit from here and now I want to build it so dotnet build so it's taken care of doing all the steps that are required to build this and produce an executable from it the build was successful we once again take a look at the folders that we have within here there's new folder that's called bin let's see what's inside of bin hey there's the bug so go inside there and there's one more folder inside of it net core app 3.1 and within here there's number files but you can see our executable is among them hello world so if I run that then there's my message hello world from JT neeti so that's all that's necessary in order to get the dotnet core SDK and runtime installed on a Raspberry Pi now just one other thing I didn't mention I'm doing this in a Raspberry Pi 3 right now I've already general on my Raspberry Pi for if you try it on the Raspberry Pi 0 you're gonna to bring into a bit of an issue you can get as far as compiling they're not running and part of the reason is the dotnet core runtime expects you to have an arm 7 processor whereas the Raspberry Pi 0 has an arm 6 processor but that doesn't mean that the dotnet core runtime is completely unavailable to you there are some ways to get some of the functionality of it available within the raspberry pi 0 and I'll show you how to do that in another video thanks for watching if you found this interesting I also have a blog if you go to jty any t it'll redirect you to the blog where you'll be able to find a write-up about this and many other things there so if you're interested check it out and if you've got any questions feel free to leave them in the comments area below bye
Info
Channel: Joel Johnson
Views: 16,699
Rating: undefined out of 5
Keywords: .Net, .NET Core, Raspberry Pi
Id: WDlZ3f2xHcc
Channel Id: undefined
Length: 10min 35sec (635 seconds)
Published: Sat Apr 11 2020
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.