ASP.NET 5 beta 7

ASP.NET 5 beta 7 announced, What is new? Part – 2

Microsoft ASP.NET team has released ASP.NET 5 beta 7. I have blogged already in my previous blog post about ASP.NET 5 beta 7 announced, What is new? Part – 1

ASP.NET 5 beta 7
What is new in ASP.NET 5 beta 7

Improvements and bug fixes in ASP.NET 5 beta 7

As we have discussed some of the improvements and bug fixes in my previous post. There are more improvements in ASP.NET 5 beta 7 and we are going to discuss here.

File provider abstraction for 5 runtime contains IFileInfo and IFileProvider.

In this release of Microsoft ASP.NET 5 beta 7, they have improved the self-hosting capability and manageability. Self-hosting like OWIN decouple the application from the web server. It is just entry point when self-hosting an application.

HttpAbstractions contains HTTP components like HttpRequest, HttpResponse, IBuilder and types required to create hosting pipelines.

With the release of ASP.NET 5 beta 7, HttpAbstractions has some improvements and bug fixes. There were changes like add new method HttpRequest.GetFullUrl() and merge FeatureModel and Features packages. There was also bug fix like NotImplementedExceptions when implementing IFeatureCollection.

ASP.NET Identity is the membership framework for building ASP.NET application with login features with user management.

In ASP.NET 5 beta 7 release, they have made property UserStore.Users as virtual, and fixes bug like custom IdentityErrorDescriber constructor hits at least 7 times per request.

KestrelHttpServer has a web server for ASP.NET 5 which is based on repo libuv. Kestrel now supports writing chunked responses automatically when no content length is specified for the response. Kestrel now uses write-behind buffering to efficiently write responses to the network. It has also improvements like add server headers like X-Powered-By, X-AspNet-Version into the response.

It has interfaces and implementations for providing localization support into your ASP.NET applications. It has a release for ASP.NET beta 7.

Logging provides common logging abstraction for ASP.NET 5. Some community framework like Serilog and adapt Microsoft.Framework.Logging module and created Providers.

This project contains implementation for System.Data.Common for SQLite to create data provider and binds to the native SQLite library. To use Microsoft.Data.Sqllite you have to install a sqllite library. The prerequisite to using Microsoft.Data.sqlliste is a version of Sqllite 3.7.15 and greater.

To use with Linux, you have to install “libsqlite3-dev”, because which is not installed by default. You can use the following command to install on Linux.

sudo apt-get install libsqlite3-dev

With ASP.NET 5 beta 7 there was obvious some bug fixes.

MVC (Model View Controller Framework for ASP.NET)
MVC provides you the ability to write clean, pattern based application, and dynamic application. It has the ability to write Test Driven Development application.

  • The release of ASP.NET 5 beta 7 has improvement like add IMvcBuilder overloads for localization and XML formatters.
  • Add URL resolving TagHelper to replace Razor.
  • Should be able to return ViewComponents from controller actions.
  • Some Dictionaries do not get model bound.
  • Make HTML rendering deferred (IHtmlContent)

You can find more improvements and bug fixes at GitHub

You can configure and access setting of POCO with Options Framework.

The release of ASP.NET 5 beta 7 has more to discuss. So shortly, I will write more about ASP.NET 5 beta 7 in near feature.

ASP.NET 5 beta 7

ASP.NET 5 beta 7 announced, What is new? Part – 1

Hey friends, as I have promise you to come up with new things in web stack, I have decided to write on ASP.NET beta 7 release.

Microsoft has just released ASP.NET beta 7 as a NuGet Package, it also include tooling update for VS 2015 RTM. With this release announcement Microsoft has also announce its first public preview of the DNX.

What is DNX?
There is an obvious question for new developers about DNX. DNX is .NET Execution Environment for .NET core on Linux and Mac machines. DNX is independent execution environment and you don’t need Mono anymore to build and run the application in Linux and Mac.

ASP.NET 5 beta 7
What is new in ASP.NET 5 beta 7

Improvements and bug fixes in ASP.NET 5 beta 7

With the new release, there is obvious new features and some bug fixes. You can find then in following sections.

In scenario mention in the article, the error message says that required anti-forgery cookie “__RequestVerificationToken” is not present  and it mention the form field. Now they fixed that with appropriate error message.

ASP.NET beta 7 now supports following Caching

  1. Output caching
  2. In memory cache
  3. Distributed cache
  4. Using Redis

There was some architectural changes after BCL API review and rename some names. They also fix issue that ConfigurationBinder throw a TargetParameterCountException. You can find more about the issue on GitHub.

CORS (Cross-Origin Resource Sharing)
To prevent malicious sites from accessing your data and page content from another site and that restriction is called Same-Origin request. Cross-Origin Request was also prevented in the case of AJAX call. However, sometimes you are in a need to give access or let another site to access or make Cross-Origin Requests.

CORS (Cross-Origin Resource Sharing) is a w3c standard, and server let specific site make Cross-Origin Request and say good bye to Same-Origin Request policy, but intact for another site. This technique is also powerful and flexible than JSONP.

Data Protection
Now a day e-Commerce is bursting and sites are storing more sensitive information than banks, hence data protection is more important for security reasons. Microsoft Window has support for DPAPI for the desktop application, but this is unsuitable for web stack. So, ASP.NET has Data Protection API to protect web data with more reliable and secure way with key encryption, management, and rotation.

Dependency Injection
There was some improvements and bug fixes in Dependency Injection that you can found at GitHub. With the addition to that you can get better error message with incompatible package dependencies.

ASP.NET 5 come up with new features Diagnostics API that help developer to diagnose issues in development and production environment. Now you can configure it in Configure() method inside Startup class. You have ability do display less information in production and descriptive error messages for production environment by controlling error page and ASPNET_ENV variable.

Now, You can also configure runtimeinfo page by simply calling UseRuntimeInfoPage extention method in Startup class. After adding runtimeinfo page you can browse /runtimeinfo page to look at your ASP.NET runtime information.

.NET SDK Version manager is use full to manage DNX. DNVM has a set of command line utilities to configure .NET runtime version on Linux and MAC environment.

This topic required more attention as DNX very helpful to run your code into Linux and MAC environment. There is lots of improvement and bug fixes that you can find at GitHub.

Entity Framework
With the release of ASP.NET beta 7 there was new feature that reverse engineer model from database and convention based model builder support for Data Annotations, which includes following attributes to be implemented.

  • Key
  • Required
  • MaxLength
  • NotMapped
  • ConcurrencyCheck
  • TimeStamp
  • Table
  • Column
  • DatabaseGenerated
  • StringLength

There was also some relational attributes

  • ForeignKey
  • InverseProperty
  • Required

There was not support for complex types yet.

Still, There is lot more in release of ASP.NET beta 7, hence I have divided this post into couple of post and shortly I will come up with rest of features that released with ASP.NET beta 7. Thank you.