Creating ASP.NET 5 Web Application using Yeoman Generator

Posted by Anuraj on Wednesday, July 29, 2015 Reading time :1 minute

.Net ASP.Net ASP.Net MVC HTML5 Javascript Web API

In this post we will explore the ASP.NET 5 Yeoman generator. What is Yeoman? Yeoman is a set of tools that facilitates building web applications. To use Yeoman, you need to install nodejs and yo package. So here is the installation steps for ASP.NET 5 Yeoman generator.

Enabling Cross-Origin Requests in ASP.NET5

Posted by Anuraj on Tuesday, July 28, 2015 Reading time :1 minute

.Net ASP.Net ASP.Net MVC HTML5 Javascript Web API

Cross-origin resource sharing (CORS) is a mechanism that allows restricted resources (e.g. fonts, JavaScript, etc.) on a web page to be requested from another domain outside the domain from which the resource originated. “Cross-domain” AJAX requests are forbidden by default because of their ability to perform advanced requests (POST, PUT, DELETE and other types of HTTP requests, along with specifying custom HTTP headers) that introduce many cross-site scripting security issues. CORS defines a way in which a browser and server can interact to safely determine whether or not to allow the cross-origin request. It allows for more freedom and functionality than purely same-origin requests, but is more secure than simply allowing all cross-origin requests. It is a recommended standard of the W3C.

Microsoft Openness event on 25 July 2015

Posted by Anuraj on Thursday, July 23, 2015 Reading time :1 minute

.Net ASP.Net Miscellaneous User Group Activities Windows Azure

Registration URL: K-MUG:

Basic authentication middleware for ASP.NET 5

Posted by Anuraj on Thursday, July 23, 2015 Reading time :1 minute

.Net ASP.Net ASP.Net MVC Visual Studio Web API

This post is about building another middleware component for ASP.NET 5. Long back I wrote a post about Basic authentication for Web API. This implementation uses the same functionality. It checks for Authorization header in the HTTP Request, if not found it set the Response status code to 401 and adds a WWW-Authenticate header. When browser receives such response, it will show the Basic authentication dialog. If the header is set, you can parse the header and validate the credentials against database. Here is the implementation.

Unit Testing ASP.NET 5 middleware

Posted by Anuraj on Tuesday, July 14, 2015 Reading time :1 minute

.Net ASP.Net ASP.Net MVC Unit Testing

This post is about unit testing your middleware components. For testing middleware ASP.NET team introduced a TestHost package, this package contains a TestServer which can create an ASP.NET request processing pipeline and helpers to submit requests to the pipeline as if it is a real server. Requests made with these helpers never hit the network as they are processed directly in memory. . You can verify the content type, http status code etc. To write unit test, you require “Microsoft.AspNet.TestHost” package and dnx supported XUnit packages as well.

Build your own middleware - HTML Minification middleware

Posted by Anuraj on Monday, July 13, 2015 Reading time :1 minute

.Net ASP.Net ASP.Net MVC Visual Studio

Minification refers to the process of removing unnecessary or redundant data without affecting how the resource is processed by the browser - e.g. code comments and formatting, removing unused code, using shorter variable and function names, and so on. If you are using wordpress, you will get some plugins which will help you to minify HTML and other static files like CSS, Javascript. ASP.NET MVC comes with bundling and minification feature which will help you to minify CSS and Javascript. This post is about a HTML Minification middleware, which will help developers to remove the whitespace in the generated HTML content.

Build your first ASP.NET 5 middleware

Posted by Anuraj on Wednesday, July 8, 2015 Reading time :1 minute

.Net .Net 3.0 / 3.5 ASP.Net ASP.Net MVC

This post is about developing your own ASP.NET 5 middleware. What is Middleware - The definition of “Middleware” varies depends on its context, but in ASP.NET 5, the definition provided by the OWIN specification is probably closest - Pass through components that form a pipeline between a server and application to inspect, route, or modify request and response messages for a specific purpose. Middleware components are similar to ASP.NET HttpModules and/or HttpHandlers. You can access the ASP.NET request pipeline via Startup.cs class, Configure() method. Configure method helps developers to plugin middleware components. Here is the Startup.cs from HelloMVC sample project
BMC logoBuy me a coffee

Copyright © 2020 - Anuraj P. 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. Hosted with ❤ by GitHub