##.NET Code running on a Raspberry Pi
Getting the new ASP.NET vNext running on a Raspberry Pi 2 or 3 is challenging but doable. These are the commands and scripts that I use in order to get everything installed and running properly. This scripts are designed to work in conjunction with my upcoming presentations and a free ebook that I'm working on. You can check out a early beta version of the ebook here.
###Steps to get your Pi running Mono and ASP.NET vNext
- Install Raspbian on your Pi
- Down load the getScripts file with the wget command
- Mark it as executable with the chmod command
- Run that file and follow the commands in the comments
- Update your OS by running sh 2_update_os
- Install Mono by running sh 3_install_mono
- Install certs needed for kvm by running sh 4_install_certs
- Install kvm by running sh 5_install_kvm
- Install libuv by running sh 6_install_libuv
wget https://raw.githubusercontent.com/lluppes/pisharp/master/getScripts chmod 755 getScripts sh getScripts sh 2_update_os sh 3_install_mono sh 4_install_certs sh 5_install_kvm sh 6_install_libuv
You should now be able to run your new ASP.NET programs! There is still a bug somewhere that is creating a duplicate environment variable that needs to be removed so that command is in this list.
###To run a sample MVC6 Web Page
- Change to the source directory
- Remove that pesky RUNLEVEL variable
- Go get the dependencies with kpm restore
- Start the web server with k kestrel
- Open your browser and navigate to http://localhost:5004
cd /home/pi/aspnet5/home/samples/HelloMVC unset RUNLEVEL kpm restore k kestrel
Let me know if you have problems with these scripts!