ASP.NET CORE: Upgrade from RC1 to RC2

RC2 of .Net Core is out, so it’s time to upgrade your apps. The official documentation on how to upgrade can be found on: https://docs.asp.net/en/latest/migration/rc1-to-rc2.html

Here is the list of things I did to upgrade my existing ASP.NET CORE RC1 apps to RC2 :

Without VS2015:

  • Updated Yeoman: yo, choose Update Generators
  • With Yeoman create a new: yo aspnet, Web Application Basic.
  • Copy the content of the project.json to my existing application
  • From inside the project folder I run from the command line: dotnet restore
  • To test if everything work file: dotnet run

With VS20015:

  • Remove all VS2015 specific files: *.sln, .vs, *.xproj, *.xproj.user
  • Delete the existing package.json and copy an existing package.json inside the project (created with file, new project, web, ASP.NET Core Web Application).
  • Open the project with Visual Studio, here VS2015 crashed!
  • I needed to copy some parts of the xproj project file created with the template. Mainly the TargetFrameworkVersion part.
  • Re-open my solution, compile, run, it worked!

I had also to do minor adaptations in my code. I had to port from the namespace Microsoft.AspNet.* to Microsoft.AspNetCore.*

If you want to target the .Net framework you need to:

  1. Change the framework part of your project.json:
    “frameworks”: {
    “net461”: {}
    },
  2. Remove: “Microsoft.NETCore.App” from the dependencies.

Leave a Reply