ASP. NET 5 Runtime upgrade to BETA5

Source: Internet
Author: User
Tags httpcontext xunit

Before the release of Visual Studio RTM and Windows 10, Microsoft opened the open source. NET has been upgraded to BETA5, bringing some enhancements and changes. The ASP. NET 5 runtime installed with Visual Studio RC is Beta4, and Microsoft released the BETA5 version of the runtime a few days ago. The entire upgrade consists of the following:

    • . NET execution Environment (DNX)
      • Support for NuGet v3, faster recovery of packages
      • Support for new. NET Target Framework monitor (TFM)
      • Links to Language and release notes can be set in Project.json
      • Eliminates fixed version requirements for Json.NET: Your application is no longer required to use and DNX a consistent version of Json.NET
      • The new Iruntimeenvironment service
    • ASP. NET 5 function library
      • Httpcontext.connection, the connection information can be obtained through the HttpContext
      • Provides localized abstractions and middleware, and provides examples to help you understand usage
      • CTRL + C is the shortcut key for unified termination of the ASP.
    • MVC 6
      • New features in Razor support for C # 6
      • Simplifies option settings for MVC and adds top-level configuration
      • JSON helper can be used in the view to serialize the data model
      • You can use the wildcard substitution in the route tag
      • The new Imagetaghelper
      • Tag Helper supports binding dictionary properties
      • Tag Helper supports conditional binding

asp.net 5 Beta5 now Available Span style= "font-family: the song Body;" It also gives a list of breaking changes, the main change being configuration entity Framework 7 change in data migration. See also: https://github.com/aspnet/announcements/issues?q=milestone% 3a1.0.0-beta5

put ASP. 5 the project code from Beta 4 Upgrade to Beta5 followed the article ASP. 5 Beta5 now Available the basic steps mentioned in the article.

1 , install or upgrade DNVM .

If not . NET version Manager (DNVM), which needs to be installed by the following code (if you have already done the following code will also be upgraded to the latest version):

1: @powershell-noprofile-executionpolicy unrestricted-command "&{$Branch = ' dev '; IEX (new-object net.webclient). Downloadstring (' Https://raw.githubusercontent.com/aspnet/Home/dev/dnvminstall.ps1 ')} "

theoretically, Execute the above code to put DNVM install (or upgrade) to command.

If you already have a beta4 of the DNVM , the command-line window needs to be restarted to see the latest DNVM version; Of course, I also encountered a strange problem, is to execute the above code after death can not upgrade, finally helpless, had to perform the second step (see: Upgrade DNX run-time), and then you will see DNVM also automatically upgraded to the latest version.

2 , upgrade DNX run time.

If the upgrade is normalDNVM, then there is no need to set"Dnx_feed"environment variables, because the latest version of theDNVMThe default address is already"https://www.nuget.org/api/v2". Now only need to execute"DNVM Upgrade"you can download and installASP. 5of theBeta5run time (the default isCLR x86), the runtime is automatically set to the active state anddefaultaliases.

of course if not upgraded DNVM , then you can set "Dnx_feed" , and then upgrade DNX run time.

can also not set "Dnx_feed" direct execution "DNVM Upgrade" beta5 beta5-12103 Span style= "font-family: the song Body;" >). Upgrade to beta5 Span style= "Font-family:verdana;" >DNVM beta5

3 , modify Project.json the package reference in the.

Open all projects in the solution Project.json file, put all of them in the suffix "Beta4" The repair is changed to "Beta5" , Save Project.json file, VS is automatically updated to the latest Beta5 the package.

need to be aware that , xunit The related package to refer to beta5 compiled version, i.e. , " Xunit.runner.dnx ":" 2.1.0-beta3-build99 "

and the Configuration related packages, from "Microsoft.Framework.ConfigurationModel" modified to "Microsoft.Framework.Configuration" .

put "Interfaces" suffix of the repair changed to "Abstractions" .

4 to resolve code changes. According to the update mentioned in the previous article, the list of changes is particularly disruptive (https://github.com/aspnet/announcements/issues?q=milestone%3A1.0.0-beta5 ) To modify the code that compiles the problem. The main changes are:

  • EF7 migration modifies the Code interface (from attribute to method), in order to avoid a lot of code modification I'm rebuilding myself. Migration . If you need to modify, see:https://github.com/aspnet/Announcements/issues/35
  • put the name space "Microsoft.Framework.ConfigurationModel" modified to "Microsoft.Framework.Configuration" .
  • Iconfiguration.getsubkey modified to iconfiguration.getconfigurationsection
  • _globalimport.cshtml Rename to _viewimports.cshtml , after modification VS2015 There may be no reference to the type, no need to ignore (wait Vswebtools updated)
  • I explained it before . EF code mentioned in the article on Data migration "DB. Database as Sqlserverdatabase " should be changed to " db. Database as Relationaldatabase "
  • in unit tests, you must explicitly perform Services. Addlogging ()

ASP. NET 5 Runtime upgrade to BETA5

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: info-contact@alibabacloud.com 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.