ASP.NET 5 beta8

ASP.NET 5 beta8 announced

ASP.NET team has announced ASP.NET 5 beta8. You can download ASP.NET 5 beta8 using NuGet Packages and ASP.NET tooling for Visual Studio. You can find installation instruction for ASP.NET 5 beta8 for Windows, Linux, and Mac.

Document and samples of ASP.NET 5 beta8 can be found at

What is an announcement in ASP.NET 5 beta8?

There would be changes like

DNX Watch Command
DNX Watch has file watcher. Your application will be restarted when you change any file in your application. To install DNX-watch use following command

dnu commands install Microsoft.Dnx.Watcher

You can use watch command like dnx-watch . You can start to watch command from the same directory of Project.json

While publishing your application, you can Specify target frameworks
You can specify target framework of application at the time of publishing your application using the following command

dnu publish -framework dnx45

and it will only trim publish package and include only those set of packages that required for your application and
resulting in smaller deployed package.

Targeting old frameworks
Now, you can target .NET 2.0 and .NET 3.5 frameworks in your DNX projects. You just need to specify net20 and net35 into target framework of Project.json file.

Clear HTTP Response Cache used for package response
When restoring packages dnu do HTTP caching for any request send. You can use the following command to clear the cache.

dnu clear-http-cache

DNVM uninstall
Whenever you are keeping updated with your latest DNX releases, you might be in a situation like DNX hanging out your machine. You can find ~/.dnx/runtimes folder into your user profile directory and delete older versions anytime. This is a just tedious task. So now, you can run dnvm uninstall to remove or uninstall specified runtime.

Add additional files to a package
DNX generating NuGet Packages for your projects, but, in that case, you are in a need to add additional files to your package. You can now add additional files to NuGet packages by specifying in project.json using new packInclude property.

"packInclude": {
    "destination1Directory/": "source1Directory/**",
    "destination2Directory/": "source2Directory/**",
    "destination2Directory/some_additional_file.txt": "source2a/somefile.txt",
    "destination3Directory/": ["source3Directory/file1.txt", "source3Directory/file2.txt"]

You can specify the set of source and destination directory to include into the package. You can also add files using pattern and array of files.

Run script for each specified framework and creating the package.
With DNX, you can handle multiple framework(like net45,net46 or dnxcore50), and multiple build configuration like debug and release). In project.json you can specify the script that run on before and after each package creation and build. before ASP.NET 5 beta8 script was run twice.

Consider you have two dotnet frameworks and two build configuration say release and debug. Now, your script can run four times once for each framework and once for each build configuration. The prepack and postpack script run twice once for each build configuration.

Change in IIS Hosting model
Up to ASP.NET 5 beta8 application runs in IIS have been hosted by the component called “Helios”, contained in the Microsoft.AspNet.Server.IIS. This component facilitated the bootstrapping of the DNX and subsequently the .NET CLR or Core CLR by way of utilizing a hook in the existing System.Web hosting model to replace the runtime after the application had started.

In ASP.NET 5 beta8, they have discontinued the “Helios” IIS host to reduce complexity and manageability of two hosting environments. Now, Hosting ASP.NET 5 applications in IIS will now be achieved using the IIS HttpPlatformHandler configured to forward through to the ASP.NET 5 Kestrel server. HttpPlatformHandler module is native IIS module hence it needs to be install by Administrator.

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.