ASP. NET 5 adventure (6): Upgrade ASP. NET 5 to beta6, asp. netbeta6

Source: Internet
Author: User

ASP. NET 5 adventure (6): Upgrade ASP. NET 5 to beta6, asp. netbeta6

(This article is also published in my public account "dotNET daily excellent article". Welcome to the QR code on the right to follow it .)

Note: Microsoft released beta6 as scheduled Based on the ASP. NET 5 Road Map. Now let's talk about some problems with upgrading beta5 to beta6.

Microsoft previously announced the ASP. NET 5 roadmap (https://github.com/aspnet/home/wiki/roadmap ). According to this roadmap, ASP. NET 5 beta6 was released in July 27. Microsoft released Visual Studio July 20 RTM in 2015 (with built-in ASP. NET 5 beta5), so beta6 still needs to be manually installed. In order to install Visual Studio July 30 RTM after installing Windows 10 on April 9, 2015, the project code was upgraded to beta6 yesterday.

Although beta5 can be upgraded to beta6 using the previous method (public number reply: 20150707), Microsoft provided us with the installation package for upgrade, because VS2015 has already RTM, download from here (http://go.microsoft.com/fwlink? LinkID = 619565 ). One of the installation packages is used to install dnvm (x64 and x86), and the other is used for installation and Runtime (with different language versions ).

After upgrading the dnvm and dnx runtime, all you have to do is make some changes based on beta6 (https://github.com/aspnet/Announcements/issues? Q = is % 3 Aopen + is % 3 Aissue + milestone % 3A1. 0.0-beta6) solves code compilation and running problems. The following describes some problems encountered in my project code:

  • The Mvc function is divided into more elaborate packages to facilitate smaller addition and dependency. For example, ViewContext, ViewContextAttribute, and IHtmlHelper are moved to Microsoft. AspNet. Mvc. ViewFeatures.
  • The format of the project. lock. json file is changed and eventually fixed, so you need to re-Execute "dnu restore"
  • Builder. ForSqlServer (). UseIdentity (); Use builder. UseSqlServerIdentityColumns ();
  • Use DbContextOptionsBuilder for EntityOptionsBuilder
  • Microsoft. DataAnnotations was abandoned (in fact beta4 gave up, I still referenced it before), now does not use IndexAttribute, but uses FluentAPI to define the index, for more information (https://github.com/aspnet/EntityFramework/issues/1698)
  • Microsoft. Framework. CodeGenerators. Mvc does not have the beta6 version, but it does not seem to be blocked for the moment.
  • Use ISession for ISessionCollection
  • Use SignInAsync for SignIn and SignOutAsync for SignOut
  • UseInMemorySession instead of UseSession
  • ErrorPageOptions. ShowAll discard
  • The code for calling database initialization in Starup needs to be changed, see my Issue Report on GitHub (https://github.com/aspnet/Identity/issues/529)
  • As a foreign key attribute, if it is a string, the length of the string should be clearly defined (previously, it can be automatically set according to the direction to the primary key)
  • The scaffolding of Beta6 (that is, the default project code structure) has changed, mainly involving the front-end package reference bower part.

The above are some of the experiences of upgrading beta6.

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.