Asp.Net Core – Open Source

In the recent times we have seen some steps taken by Microsoft which are really encouraging for the .Net community and Microsoft customers as a whole. They have taken some bold actions to change the restrictive image that we used to have for Microsoft, its platform and tools. Some of the brave actions which indicate that Microsoft is moving away from proprietary product based company to a service based organisation are:

  • They have open-sourced .Net Core, Asp.Net and MVC frameworks (including the compiler platform Roslyn).
  • Azure platform now offers full support for open source tools like Hadoop (not to mention Linux distros which are also available).

Today I setup a full blown development environment for Asp.Net on Mac using tools which are free and open source. In this post I will list down the process of creating an Asp.Net website using yeoman and then running it using “dotnet” CLI on MacBook. Before I start I would like to say that they have managed to combine the process so seamlessly with a variety of tools that you get both the power that was generally associated with Unix based environments and the great scaffolding experience that was an MO for Microsoft development environment (Visual Studio). They have done a pretty good job of using the open source tools to provide the almost same experience (not exact because Visual Studio is a mature product and has been around since I was a kid). The code for Asp.Net website so created is platform independent and it can be hosted on any platform and in fact you can take this project as it is and use it in Visual Studio 2015.

Step 1: Install .Net Core (detailed instructions are here)

.Net Core is the runtime and framework package that is open source and runs on Windows, Mac and Linux (almost all – I have not verified it yet but there is a article describing the process of setting up and publishing applications to Linux). What does it mean, it means that now you can have Asp.Net applications running on any platform (including IoT devices like Raspberry pi, MinnowBoard etc.). I will write a separate post about IoT development choices.

Step 2: Install Visual Studio Code (detailed instructions are here)

Visual studio code is a general purpose free code editor which can be extended with free community extensions and productivity tools. Its a general purpose code editor which means that you can do any kind of code editing and then have platform specific execution and debugging extensions plugged in. After installing Visual studio code you need to install C# extension for Visual studio code. C# extension enables you to create/refactor/analyse and run and debug C# code from Visual studio code. It provides features like syntax highlighting, code completion and intellisense inside Visual studio code.

Step 3: Install NodeJs package with NPM.

NPM is a package manager which would come handy for installing packages and tools like yeoman, bower and gulp which will assist us in various stages of Asp.Net application development.

Step 4: Install yeoman Asp.Net generator for scaffolding

Yeoman is a scaffolding/template tool that generates project and structures for given set of client tools. What this means is that we would be using “yo” CLI for creating an Asp.Net project (those of you coming from Visual Studio background: this is same as [File->New Project] that we did in Visual Studio).

Step 5: Create an Empty Web Application

Follow the following steps to create a web application (in terminal window) with basic project files and packages pre-configured:

navigate to the directory where you wish to create the project (using cd command), once inside the directory type the below command:

: yo aspnet

This will bring up the aspnet generator options, select “Web Application Basic [Without Membership and Authorization]”, once selected you would need to define the following for your application:

  1. UI Framework: Select Bootstrap (whatever version is available).
  2. App Name: name of your web application.

Once completed type the following commands to build and run your web application:

: cd “[your web application name]”

: dotnet restore

: dotnet build

: dotnet run

This would restore the packages, build your applications and run the application in Kestral web server.

This should bring up information about your web application such as url and port number (mine is localhost:5000) and you can navigate to the default page in a browser which looks like.


This is the same empty application that you get in Visual Studio when you fire up [File -> New Project].

In the next post we would be discussing about opening and editing your newly created web application using Visual Studio Code and then subsequently creating a useful web application (I have an idea or two lets see which one I am going to choose).

See you soon with next steps.

Until then…


Other posts

  • Building Your First Neural Network with TensorFlow – Deep Learning 2

    Building Your First Neural Network with TensorFlow – Deep Learning 2

    Neural networks are a fundamental concept in deep learning and are used for a wide range of applications such as image and speech recognition, natural language processing, and much more. In this article, we will walk you through the process of building your first neural network using TensorFlow, a popular open-source machine learning library. We'll…

  • Introduction to Deep Learning with TensorFlow – Deep Learning 1

    Introduction to Deep Learning with TensorFlow – Deep Learning 1

    In this article, we provide an introduction to deep learning with TensorFlow. We cover what deep learning is, what it can do, why TensorFlow is a great choice for deep learning, and an overview of TensorFlow itself. We also explore the different types of neural networks used in deep learning, and demonstrate how to build…

  • How To: Set Up PyTorch with GPU Support on Windows 11 – A Comprehensive Guide

    How To: Set Up PyTorch with GPU Support on Windows 11 – A Comprehensive Guide

    Introduction Hello tech enthusiasts! Pradeep here, your trusted source for all things related to machine learning, deep learning, and Python. As you know, I’ve previously covered setting up TensorFlow on Windows. Today, I’m excited to bring you a detailed guide on setting up another popular deep learning framework, PyTorch, with GPU support on Windows 11.…

  • Solving a Complex Logistics Optimization Problem using the Pulp Library in Python – Part 4

    Solving a Complex Logistics Optimization Problem using the Pulp Library in Python – Part 4

    In this article, we demonstrate how to solve a logistics optimization problem using the Pulp library in Python. By defining the variables, objective function, and constraints, and using the solve method to find the optimal solution, we are able to minimize the total cost of transportation while satisfying the constraints. This article concludes the multi-part…

  • Linear Programming in Python using PuLP – Part 3: Optimizing Investment Portfolios with Multi-Objective Optimization

    Linear Programming in Python using PuLP – Part 3: Optimizing Investment Portfolios with Multi-Objective Optimization

    In this article, we used the Pulp library in Python to solve a linear programming problem to find the optimal investment portfolio. We defined variables, added constraints, defined objectives, and solved the problem to find the optimal solution that balances the trade-off between maximizing returns and minimizing risk. The code was concise and easy to…

  • Linear Programming in Python using Pulp – Part 2

    Linear Programming in Python using Pulp – Part 2

    In this article, we delve deeper into linear programming and explore how to solve a multi-objective optimization problem using the Pulp library in Python. We present a problem in which a nutritionist must find the optimal meal plan for a patient suffering from anemia, balancing the intake of Vitamin B12 and fat. We demonstrate how…

  • Linear Programming in Python using PuLP – Part 1

    Linear Programming in Python using PuLP – Part 1

    Linear programming is an optimization technique used to find the best outcomes for a given problem. This technique relies on a set of constructs which are all expressed using a system of linear equations. It is important to understand that you should be able to express your objective as a linear equation dependent on an…

  • How To: Setup Tensorflow With GPU Support using Docker

    How To: Setup Tensorflow With GPU Support using Docker

    Previously I published a guide for setting up tensorflow in an anconda environment with GPU support. A lot of people liked it and I have been working with this environment myself for more than a year now. I am happy with the results however the process is a bit involved and requires quite a bit…

  • How To: Setup Tensorflow With GPU Support in Windows 11

    How To: Setup Tensorflow With GPU Support in Windows 11

    It's been just 2 days since Windows 11 came out and I am already setting up my system for the ultimate machine learning environment. Today we are going to setup a new anaconda environment with tensorflow 2.5 with GPU support using NVIDIA CUDA 11.4 and CUDNN 8.2.4 along with Python 3.8. This is going to…

  • Tools of The Trade – II

    Tools of The Trade – II

    In continuation of my previous post today I will talk about the website I did this project on request of my wife because she wanted to pursue blogging and didn't want to go through the ordeal needed to write, publish and manage SEO using most of the prominent blogging platforms like WordPress, Joomla, Drupal…

  • Tools of The Trade – I

    Tools of The Trade – I

    In this post I will share a few tools and technologies that I am using to run a couple of blazing fast websites using latest modern tools and technologies. The caveat here is that I don't pay any infrastructure/hosting costs for any of these websites and they can scale infinitely in terms of supported users…

  • Building Lizzie – IV

    Building Lizzie – IV

    Another post about Lizzie. I started off with a Raspberry Pi 3 to build a personal assistant for my car and I have come a long way both in terms of the concept and the functionality. Most importantly I have formalized the application flow and also extended the scope from one device to almost all…

  • OBD-II with Raspberry Pi3

    OBD-II with Raspberry Pi3

    I am writing this article in response to a question posted on my YouTube channel. Here I would be talking about communicating to an OBD-II device (ELM327 chip with Bluetooth) hooked into your car’s OBD-II port. The OS I am using is Windows 10 IoT core. This information is important because it makes a difference…

  • Building Lizzie – III

    Building Lizzie – III

    As mentioned in previous article today I would be talking about OBD-II integration in Lizzie using a Bluetooth serial communication with an ELM327 adapter that fits on a OBD-II port in your car. OBD stands for On Board Diagnostics which is connected to the ECU (Engine Control Unit) and provides a ton of information (both…

  • Building Lizzie – II

    Building Lizzie – II

    In the previous post I described my experiments around building an intelligent artificial personal assistant – Lizzie. The pseudo intelligent agents available today around us (Siri, Cortana or Google Next) are all great feats of engineering given the fact that they reside on small devices like mobile phones and are able to do powerful things…

  • Building Lizzie – I

    Building Lizzie – I

    Recently I have been busy building a personal assistant that I would be fitting in my car. Currently I am in experimentation mode and I am experimenting with speech capabilities. I would start with a description of my journey so far. First let me show off a little bit with these videos that I created…

%d bloggers like this: