Category: ASP.Net Core

0

Migrate ASP.Net Core Application from XProj/Project.json to CSProj/MSBuild

In this tutorial, we are going to see how to migrate an existing ASP.Net Core Web Project which is based on XProj and Project.json to support new CSProj and MSBuild tooling. ASP.Net Core is a ground up design and to support multiple environments and platforms, ASP.Net team decided to go with XProj/Project.json approach which is light-weight and easy to modify dependencies, target frameworks etc. But the interoperability between different .Net Application Models (which are based on CSProj and MSBuild) with ASP.Net Core Applications faced challenges.

0

Continuous Integration and Deployment of ASP.Net Core 1.0 Docker Image to Azure Ubuntu Virtual Machine using GitHub and Docker Cloud

In this tutorial, we are going to see how to get continuous integration and continuous deployment of a Docker image created for ASP.Net Core 1.0 Application to an Azure Ubuntu Virtual Machine. We are going to use GitHub as version control repository where our application code along with Docker file resides. We will use Docker Cloud to automatically build images on every code push to the GitHub repository. Finally we will configure Docker cloud to build the latest image and deploy the Docker container to an Azure Ubuntu Virtual Machine.

0

Deploy an ASP.Net Core 1.0 Docker Image to Azure Ubuntu Virtual Machine

In this tutorial, we are going to see how to deploy a Docker image created with ASP.Net Core 1.0 Application to an Ubuntu Virtual Machine created in Microsoft Azure Cloud. Docker helps us in creating packages for our application into standard images. These Docker images are ready to be deployed on Docker Containers and can run on any environment.

0

Create and Deploy Docker Container of ASP.Net Core 1.0 Application to Azure Linux Web Application

In this tutorial, we are going to see how to create and deploy a Docker Image for an ASP.Net Core 1.0 Application. At the end of this tutorial we are going to deploy the Docker image to Azure Linux Web App. Docker helps us in creating packages for our application into standard images. These Docker images are ready to be deployed on Docker Containers and can run on any environment. A Docker Image is a read-only template with instructions for creating a Docker container. A Docker Container is the execution environment and it is created from a Docker image.

0

JumpStart # 51 – Dependency Injection into Views in ASP.Net Core

In this jumpstart, we are going to see how to inject dependencies into a View in ASP.Net Core. This feature is extremely useful when we need to use certain functionality or data in views and without including them in regular controller models. For example, populating master data to some controls like select, formatting different data and using application wide features like Globalization and localization.

0

JumpStart # 50 – User Secrets in ASP.Net Core

Most of the time we maintain project specific confidential credentials like Database connection strings, passwords etc., in configuration files. This sensitive information will be pushed to source version control servers like Team foundation server with regular check-ins. This is a bad practice because the sensitive information will be at risk (especially in case of public repositories).

0

Reusable View Components in ASP.Net Core 1.1

In traditional ASP.Net MVC, we achieve reusable user interfaces through Partial Views. Starting with ASP.Net MVC Core, we have View components replacing the concept of Partial Views and Child only Actions. View Components can be in their own class libraries and can be referenced by multiple web projects. View Components are more independent as they are not coupled with Controllers.

0

Cookie based TempData Provider in ASP.Net Core

TempData in ASP.NET MVC is used to store temporary data which can be used in the subsequent request. Data stored in TempData will be cleared once it is accessed, we need to call TempData.Keep() explicitly to retain values. The default TempData implementation in ASP.NET MVC is based on Session. In ASP.Net Core, we have a provision to use Cookies as storage for TempData.

0

Middleware Filters in ASP.Net Core

In ASP.Net Core, Middlewares are configured and executed as part of global request pipeline and are executed on every Controller action execution. Starting with ASP.Net Core, we can apply middlewares to specific controllers and actions. In this tutorial, we are going to see how to use middlewares as filters on specific controller actions.

0

Response Caching in ASP.Net Core

Response Caching helps in improving performance of web server by caching relevant content based on certain criteria. Response caching is available in all versions of ASP.Net. In ASP.Net Core, there is a new Response Caching Middleware through which we can configure the caching options in Startup class. In this tutorial, we are going to see how to implement Response Caching middleware.

0

Upgrading from ASP.Net Core 1.0 to ASP.Net Core 1.1

We have ASP.Net Core 1.0 along with .Net Core 1.0 SDK for quite some time. Microsoft recently released ASP.Net Core 1.1 along with .Net Core 1.1 SDK. There are many new improvements as part of the new release which includes middlewares like URL Rewriting, Response Caching etc., and improved deployment and hosting capabilities. In this tutorial, we are going to see how to install and get started with ASP.Net Core 1.1.

0

Create Nuget package from .Net Core 1 Class Library

In this tutorial we are going to see how to create a Nuget package from .Net Core 1 Class Library project. In previous versions of .Net, creating a nuget from class library is a big task which involves in adding build artifacts and dependencies. Starting from .Net Core, creating a nuget package made simpler and it is supported by Dotnet CLI.

0

ASP.Net Core Web API Versioning

In this tutorial, we are going to see how to support versioning for ASP.Net Core Web API endpoints. Versioning helps API owners to roll out enhanced functionalities to different customers on a time to time basis without breaking the old versions of endpoints. In previous versions of ASP.Net, we used to create a custom IHttpControllerSelector through which we will route the request to appropriate controller version based on custom header or URL pattern. In ASP.Net Core, we will use aspnet-api-versioning middleware (created by Chris Martinez).

0

Demystify Publish folder of an ASP.Net Core MVC Application

In this tutorial we are going to demystify the contents of Publish folder of an ASP.Net Core MVC application. To host an ASP.Net Core Application, we publish it using dotnet publish command of Dotnet CLI. Publish folder is created as an output of dotnet publish command and it contains all the necessary dependencies along with project artifacts for successful project hosting.

0

Publish an ASP.Net Core 1 Application to IIS

In this tutorial, we are going to see how to publish an ASP.Net Core 1 Application to IIS. Unlike older versions of ASP.Net, ASP.Net Core 1 applications are not dependent on IIS for hosting. In fact ASP.Net Core 1 applications are console applications and run in their own Kestrel Web Server. But if we need to have more functionalities which IIS provides by default (or through extensions), then we can use IIS as reverse proxy which will forward requests to Kestrel.

0

In-Memory and Distributed Caching in ASP.Net Core MVC Application

Caching helps in improving performance of an application by replicating the data (otherwise which has to be fetched from database or any other source). ASP.Net Core supports both in-memory and distributed caching. In-memory caching holds the copy of data in local server’s memory, where as distributed cache maintains cache in a centralized location which is accessible by servers in cluster. In this tutorial we are going to see how to implement both in-memory and distributed caching in ASP.Net Core MVC application.

0

JumpStart # 45 – Redis Cache based Session State in ASP.Net Core MVC Application

In this Jumpstart, we are going to see how to use Redis Distributed Cache Server as Session store for an ASP.Net Core Application. There are multiple advantages in having a distributed cache storage (in this case it is Redis Cache) acting as Session store. Sessions can be shared across multiple applications and also between multiple servers in a cluster. Redis is also capable of supporting different data types and it is faster than SQL Server (because of its in-memory nature). Redis also supports cluster for scaling and persistence to disk (data will not be lost on server restarts).