Monthly Archives

8 Articles
Uninstall Dot net core Preview 2 in Ubuntu 16.04 LTS

Uninstall Dot net core Preview 2 in Ubuntu 16.04 LTS

Though the instructions at Microsoft website is really easy to follow to install Dotnet core 2.0, I realized that the web page does not have instructions that can be easily followed to remove Dotnet core preview 2.

Run the following commands to removed Dotnet core 2.

sudo apt --installed list

sudo apt --installed list | grep "dotnet-sdk"

sudo apt-get remove dotnet-sdk-2.0.0-preview2-006497

dotnet --version


ASP.Net Core MVC request life cycle – Routing

Routing bridges middleware and MVC framework by mapping incoming Http requests into controller action method. There are two different routing available in MVC.

Routes are evaluated in the order they are defined in the program. The more important routes should be defined first.
Following diagram explain the login flow of routing mechanism in Asp.Net core MVC. core mvc routing high level overview

Read More

Comparing Asp.Net core middleware with Http Modules and Handlers

Http Modules & Http Handlers

1. In the older version of Asp.Net, the Http modules hooked into Application lifecycle events to provide reusable services.

2. In the older version of Asp.Net, the Http Handlers were responsible for Generating responses for Http requests.

3. Order of execution of Http modules and Http Handlers are driven by life cycle events

Asp.Net core middleware

1. generates responses for requests.

2. Provides application level services and features.

3. Order of execution of Asp.Net core middleware are driven by the order it is added into middleware pipeline.

4. Middlewares are available in Asp.Net web api (.Net 4.5) and .Net core

ASP.Net Core MVC request life cycle – Middleware Pipeline

Middleware Pipeline

ASP Net Core MVC is built on top of a concept called Middleware. Middleware pipeline is a chain of modular components that provide essential building block of how your application handles HTTP request. These components are generating a response for an incoming request directly or with help of a framework such as MVC.

Features like Routing, sessions, CORS, Authentication, Caching etc are implemented as middleware.

Example of asp net core middleware pipeline

Read More

Dot net standard demystified: What, why and how?

Portable class Libraries and the Problem

In the beginning building applications for .Net was simple, developer had only one framework to target while building the application. This changed when Silverlight came. developers wanted to share libraries for Silverlight and .Net framework. Which caused the origin or Profiles.


Profiles are a set of reference libraries, that have references to the libraries available in different platforms. In order to make sure any specific code can be portable, you can compile your code against to specific Profile.

  • Profile 14
  • .Net framework 4.0
  • Silverlight 5.0
  • Profile 37
  • Profile 14 (.Net framework 4.0 & Silverlight 5.0)
  • .Net framework 4.5

Read More

ASP.Net Core MVC request life cycle – Overview

ASP.Net Core MVC request life cycle – Overview

Overview of Platform changes
In the past version of ASP.Net, Web forms and MVC used to share the underlying infrastructure. In .Net core these platforms are unified into one MVC. The Webforms is not part of ASP.NET core anymore.

The prior versions of ASP.NET MVC used to provide an underlying application life cycle events based on HTTP modules & handlers and IIS hosting and application level events . Http Events and Handlers are not existing in ASP.NET Core.

Most of the events and functionality are provided in ASP.Net core by middleware.

What is life cycle
A Series of components, events or stages of an application that processes a request or respond to user interaction. In MVC the request life cycle refers to all of the components and stages that interact to process an HTTP request.

Following diagram shows an overview of ASP.Net core MVC application.

Asp.Net Core MVC Life cycle overview

Read More

NUnit change order of test run

In version, 3.2 NUnit introduced a new attribute called “Order” to control the order of unit test cases run while running a test suite.

Test cases with Same order number are considered as one, NUnit will decide the order of their run.

The test cases do not have an Order number will follow the regular test run ordering. The Unit tests that have an Order number will always take precedence in Test Run.

Example source code is provided below.
Read More