Blog

Blog posts on .NET, Azure, and more.

Configuring Redis for ASP.NET Core Session Store

November 14, 2016 by Anuraj

ASP.NET Core Redis Cache Session

This post is about Configuring Redis for ASP.NET Core Session Store. Redis is an open source (BSD licensed), in-memory data structure store, used as database, cache and message broker. It supports data structures such as strings, hashes, lists, sets, sorted sets with range queries. Redis works with an in-memory dataset. it also supports persisting the dataset to disk. Moreover, It provides master-slave asynchronous replication. Redis is not officially supported on windows. However, the Microsoft Open Tech group develops and maintains Windows port targeting Win64 available here. You can install redis using chocolatey package manager, using choco install redis-64 command. Once you install redis you can run redis-server command to start the redis server.

Working with client side packages in ASP.NET Core

November 09, 2016 by Anuraj

ASP.NET Core Bower Javascript

This post is about working with client side packages in ASP.NET Core. In this post I am using Bower as client side package manager and dotnet bundle command for bundling and minification, instead of gulp or grunt. In ASP.NET world, we were using nuget for client side packages as well. Nuget is a good package manager for for .NET libraries and the Microsoft eco-system. But problem with Nuget is if someone writing a new Javascript libaray, you can’t expect them to create a nuget package and publish it. The web development world has largely settled on Bower as the defacto package manager for client side libraries. Bower is a “package manager for the web.” Bower lets you install and restore client-side packages, including JavaScript and CSS libraries. To use Bower, you need to install NodeJS first. You can download NodeJS from here.

Measuring code coverage of .NET Core applications

November 06, 2016 by Anuraj

C# ASP.NET Core Unit Testing Code Coverage .NET Core

This post is about getting code coverage of .NET Core using Opencover. This is an update post, long back I wrote a post on code coverage using ASP.NET Core in RC days. This post is using dotnet command and 1.0 version. Opencover is a code coverage tool for .NET 2 and above, support for 32 and 64 processes with both branch and sequence points; roots proudly based in PartCover - https://github.com/OpenCover/opencover/

Middleware filter in ASP.NET Core

October 28, 2016 by Anuraj

C# ASP.NET Core Middleware filter Middleware

This post is about a new feature in ASP.NET MVC, Middleware filter. Middleware typically sits in the global request handling pipeline. If you want to apply middleware to a specific controller or action method, you can use this feature. This feature only available with ASP.NET Core MVC 1.1. Long back I created a middleware (HTML Minification Middleware), which helps to minify generated HTML of an action. After few days I got a request to implement configuration options, which helps to exclude certain actions from minification. Now I can use Middleware filters instead of configuring the options.

Using Response Compression Middleware in ASP.NET Core

October 26, 2016 by Anuraj

C# ASP.NET Core Compression Middleware

This post is about using Response Compression Middleware in ASP.NET Core. Long back I wrote blog post on Enabling GZip Compression in ASP.NET5. It was a custom middleware I implemented in DNX days. Now as part of ASP.NET Core 1.1 Preview 1, Microsoft introduced Response Compression Middleware in ASP.NET Core.

Copyright © 2024 Anuraj. Blog content licensed under the Creative Commons CC BY 2.5 | Unless otherwise stated or granted, code samples licensed under the MIT license. This is a personal blog. The opinions expressed here represent my own and not those of my employer. Powered by Jekyll. Hosted with ❤ by GitHub