Monday, April 6, 2020

Learning to develop .net core on Linux - Install VS code

To install Visual Studio Code we need to open a terminal window


First install the key

sudo rpm --import https://packages.microsoft.com/keys/microsoft.asc

Install the repository

sudo sh -c 'echo -e "[code]\nname=Visual Studio Code\nbaseurl=https://packages.microsoft.com/yumrepos/vscode\nenabled=1\ngpgcheck=1\ngpgkey=https://packages.microsoft.com/keys/microsoft.asc" > /etc/yum.repos.d/vscode.repo'


Update the package cache

sudo dnf check-update


Then install code

sudo dnf install code


Now that VS code is installed

 Lets install the .net core 3.1 sdk

 First get the key and repo

sudo rpm --import https://packages.microsoft.com/keys/microsoft.asc
sudo wget -O /etc/yum.repos.d/microsoft-prod.repo https://packages.microsoft.com/config/fedora/31/prod.repo

Now we can install .net core 3.1

sudo dnf install dotnet-sdk-3.1


Make sure in Visual Studio code you install the C# extension by Microsoft

Sunday, April 5, 2020

Learning to Develop .net core on Linux - Laptop setup

I decided it would be better learn linux on an actual machine instead of a virtual machine.   I looked at some of the linux laptop available and found I like the System76 laptops but opted to get a get a cheap laptop to learn on.

The laptop I bought was a HP 15-dy1731ms


First thing I did was boot up the computer and enter the Bios by pressing F10 at startup.

In the BIOS i made 2 changes first I disabled secure boot so I could install Linux.


Second I made the USB drive a the primary boot device.



I went ahead and booted off the Fedora usb drive and installed it to the hard drive.  As part of the install I deleted the windows partitions and let fedora partition the hard drive.

Once installed I noticed that the Realtek rtl8821ce wifi did not work.  I tried the steps in this forum question and few like it but did not have any luck getting to work reliably.

https://askubuntu.com/questions/983251/installing-wi-fi-driver-for-realtek-semiconductor-rtl8723de-device-10ecd723

In the end I bought a TP-Link usb wifi adapter (that has linux support) to connect to the internet

https://www.amazon.com/gp/product/B008IFXQFU/ref=ppx_yo_dt_b_asin_title_o00_s00?ie=UTF8&psc=1

Learning to develop .net core on linux

I have been wanting to learn how to develop software for Linux for a while.  Now that Microsoft is has been making .net core work cross platform.  By cross platform I mean it works on Windows, Mac, and Linux.   I figured it was time to learn.

I see Windows 10 has been getting features added to it's Windows Subsystem for Linux.   Visual Studio Code is a light weight IDE which works cross platform (including Linux).  .Net 5 will also be cross platform. 

So I decided to get a cheap laptop and load Linux on it and see what I can do using .net on it. 

Which Linux Distro to choose.  I looked at 3 distros first Ubuntu, Mint Linux, and Fedora.  Ubuntu is a fast, simple, and secure distro.  Mint is a distro of Linux which has a similar UI to Windows 10.   Fedora is the open source version of Red Hat Linux. 

I chose to go with Fedora because it has a Developer center.  In the developer center there is section which covers .net core. 


https://developers.redhat.com/products/dotnet/overview

There is also a free ebook.  Available Transitioning to .NET Core on Red Hat Enterprise Linux

https://developers.redhat.com/promotions/dot-net-core/?intcmp=70160000000gyhZAAQ 



So to get started with Fedora  I downloaded the Fedora Media Writer and Fedora Workstation 31 iso

https://getfedora.org/en/workstation/download/

Note any usb drive you use as a Fedora boot disk will only work with Linux afterwards.  Use the Fedora Media Writer to create a boot USB you can use to install Fedora on a laptop