ASP 5 BETA8 release and upgrade experience

Source: Internet
Author: User

(This article also published in my public number "dotnet daily Essence article", Welcome to the right QR code to pay attention to. )

Preface: ASP. NET 5 Beta8 is an important milestone because this is the feature freeze version of ASP. It is strongly recommended that students who have hesitated to use ASP. NET 5 in the production environment can start experimenting.

This time as a function of the frozen version, the change relative to the Beta7 still have a lot of places.

The biggest change is to change the IIS hosting model

The previously managed mode was "both camps", and there was a host named "Helios" for IIS, in addition to the DNX host. This approach brings the complexity of development, maintenance, and testing, and also makes the internal processes of the program execution different. There is now only one DNX host, and if you want to run in IIS, you need a new Httpplatformhandler to pass the request to the Kestrel server in ASP. NET 5.

If this extension of IIS is iisexpress, you can install the BETA8 Web Tools update to get it, if not you need to install it separately.

In addition, for the old project also need to add a Web. config in wwwroot, the specific content can be seen at the end of the link or a new project with BETA8 to reference.

Next is the functionality that localization supports.

Use the app. Userequestlocalization when localization is enabled, the built-in language judgment provider will determine the current language based on the request header, query string, or cookie value. You can then use services. Addlocalization (options = options. Resourcespath = "Resources"), to pass localized string content.

Of course, the localization of MVC has also been supported.

DNX Watch command for dynamic development.

Although. NET is to support dynamic compilation, to achieve dynamic development such as Ruby, Python (that is, after the production environment modifies or pushes code, the program runs in the latest version) or need to do some additional work (or choose a framework such as webpages). The DNX Watch command is now available in ASP. NET 5 to monitor changes in all files in the project, enabling a fast development workflow: Edit the code, save it, and then refresh the browser to see the update.

Installation mode: DNU commands install Microsoft.Dnx.Watcher

Execution mode: Dnx-watch Web

In addition to these enhanced above, more can be found in the announcement and release notes of Beta8 :



Upgrade from Beta7 Beta8

Of course, the whole beta8 also brought some disruptive changes, and I combined my experience of upgrading from BETA7 to a brief introduction:

  • Targetelementattribute renamed to Htmltargetelementattribute
  • Use stringvalues instead of string[] For example, when visiting HttpContext.Request.Header, the wording is different.
  • The Useerrorhandler and Useerrorpage extensions were renamed, which is useerrorhandler->useexceptionhandler,useerrorpage-> Usedeveloperexceptionpage
  • Controller.context-Controller.httpcontext
  • Openidconnectauthenticationdefaults-Openidconnectdefaults
  • ActionExecutedContext namespace changed to Microsoft.AspNet.Mvc.Filters
  • Ioptions.options-Ioptions.value
  • Identityoptions.emailconfirmationtokenprovider-IdentityOptions.Tokens.EmailConfirmationTokenProvider
  • The controller provides such as user, request properties, and does not have to be accessed indirectly through HttpContext, but is closer to MVC5 controller usage
  • Identityservicecollectionextensions.configureidentity removal, configuration put into addidentity; Configureidentityapplicationcookie removal, configuration via IdentIT Yoptions's Cookie property configuration
  • Memoryconfigurationsource–>memoryconfigurationprovider
  • The Configurationbuilder constructor adjusts to no longer accept incoming basepath values, which is required: var configurationbuilder = new Configurationbuilder (). Setbasepath (Appenv.applicationbasepath)

    More changes to the record can be seen here:

  • BETA8 Web Tools downloads in:

    ASP 5 BETA8 release and upgrade experience

    Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.