What is the cheatsheet for upgrading from Beta 6 to Beta 7 for ASP.NET 5 vNext?
-
This thread would be more appropriate on [github](https://github.com/aspnet/home) – Victor Hurdugaci Sep 09 '15 at 07:00
-
Unfortunately I think there are too many breaking changes and even missing features for there to be a simple cheat sheet. The [ASP.NET MVC Boilerplate](https://visualstudiogallery.msdn.microsoft.com/6cf50a48-fc1e-4eaf-9e82-0b2a6705ca7d) may help show you how you can translate some things. – Muhammad Rehan Saeed Sep 09 '15 at 08:51
-
@victor-hurdugaci github issues aren't collaboratively editable and the asp.net 5 wiki isn't not editable by non collaborators. DFowler has also commented that he doesn't want beta upgrade notes polluting the wiki. SO seems a good fit for this. – fiat Sep 09 '15 at 23:48
2 Answers
Prerequisites
- Start from Beta 6 (see prior notes)
- Install Web Tools 2015 (Beta7)
- Upgrade to beta7:
dnvm upgrade
- Install x64 if you wish:
dnvm install 1.0.0-beta7 -arch x64 -r clr
- Update the alias:
dnvm alias default 1.0.0-beta7 x64
- Set it as permanent default
dnvm use default -p
Beta 7 Changes
Not all changes will be applicable to your project...
- Update
global.json
frombeta6
tobeta7
- Search project.json files for
beta6"
and replace withbeta7"
- In project.json, replace
Microsoft.Framework.Runtime.Abstractions
withMicrosoft.Dnx.Runtime.Abstractions
- In project.json, replace
Kestrel
withMicrosoft.AspNet.Server.Kestrel
- Replace
using Microsoft.Framework.Runtime;
withusing Microsoft.Dnx.Runtime;
- Replace
configuration.GetConfigurationSection
withconfiguration.GetSection
- Replace
configuration.Get("MyConfigKey")
withconfiguration["MyConfigKey"]
- In Startup.cs, replace
services.AddMvc().Configure<MvcOptions>(options =>
withservices.AddMvc(options =>
Multiple assemblies with equivalent identity error
My unit test projects had this error:
Multiple assemblies with equivalent identity have been imported: '<in-memory assembly>' and '<in-memory assembly>'
This blog suggested moving System.*
references down to framework specific section, I found removing them entirely also worked.
TagBuilders
One can no longer use TagBuilder.ToString()
to get HTML but instead must make use of the IHtmlContent
that it implements. See TagBuilder InnerHtml in ASP.NET 5 MVC 6
Entity Framework
- New syntax for migrations:
dnx ef migrations add MyMigration
anddnx ef database update
Other
- Further fixes may be found on the ASP.NET announcements repo
- Feel free to edit in your own findings
-
I'm glad I'm not the only one that ran into that weird "in-memory assembly" error! Drove me crazy for quite a while. – Brandon Martinez Sep 11 '15 at 15:01
-
If you haven't already, rename `Kestrel` in `package.json` to `Microsoft.AspNet.Server.Kestrel` – georgiosd Sep 16 '15 at 06:33
-
"dnvm alias default 1.0.0-beta7 x64" give me the following error: A positional parameter cannot be found that accepts argument 'x64' – mehran Oct 03 '15 at 08:25
-
-
Can I update it from my unit test project? My unit test uses .NET 4.5.2. I want to upgrade it. – Jan 18 '16 at 17:02
Doing the suggested "replace Microsoft.Framework.Runtime.Abstractions with Microsoft.Dnx.Runtime.Abstractions"
Resolved me having the error "Multiple assemblies with equivalent identity have been imported: '' and ''"
when I attempted to perform the upgrade.
-
That is an issue but caused by System.* references. The `Microsoft.Framework.Runtime.Abstractions` doesn't exist in Beta7 so you can't not upgrade that – fiat Sep 09 '15 at 06:55